Skip to content
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.

Commit

Permalink
use panic handling errgroup from gotools
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcz committed Mar 26, 2023
1 parent 6b5fb51 commit 24ad554
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cmd/openldap_exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
exporter "github.com/tomcz/openldap_exporter"

log "github.com/sirupsen/logrus"
"github.com/tomcz/gotools/errgroup"
"github.com/urfave/cli/v2"
"github.com/urfave/cli/v2/altsrc"
"golang.org/x/sync/errgroup"
)

const (
Expand Down Expand Up @@ -140,7 +140,7 @@ func runMain(c *cli.Context) error {
}

ctx, cancel := context.WithCancel(context.Background())
var group errgroup.Group
group := errgroup.New()
group.Go(func() error {
defer cancel()
return server.Start()
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ require (
github.com/prometheus/client_golang v1.12.1
github.com/prometheus/exporter-toolkit v0.7.3
github.com/sirupsen/logrus v1.8.1
github.com/tomcz/gotools v0.4.2
github.com/tomcz/gotools v0.4.3
github.com/urfave/cli/v2 v2.4.0
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
gopkg.in/ldap.v2 v2.5.1
)

Expand All @@ -31,6 +30,7 @@ require (
golang.org/x/crypto v0.1.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
google.golang.org/appengine v1.6.6 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/tomcz/gotools v0.4.2 h1:bforF32o12uGyJH1sJPMAkI/XeGaGylwk0XC4wKgOf8=
github.com/tomcz/gotools v0.4.2/go.mod h1:SYLitf1gefAO8soXL4ueN+z5IrkEv18Nb0W2hoOi/+s=
github.com/tomcz/gotools v0.4.3 h1:HDp2xf+V4QLBDUTITyRg3iT6xdNctOFyuD8UGtNYRxA=
github.com/tomcz/gotools v0.4.3/go.mod h1:XpogqLWZanpKfo+a2YEvtdKy1zmYVrjpMYRAzHVebD4=
github.com/urfave/cli/v2 v2.4.0 h1:m2pxjjDFgDxSPtO8WSdbndj17Wu2y8vOT86wE/tjr+I=
github.com/urfave/cli/v2 v2.4.0/go.mod h1:NX9W0zmTvedE5oDoOMs2RTC8RvdK98NTYZE5LbaEYPg=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down
3 changes: 3 additions & 0 deletions vendor/github.com/tomcz/gotools/errgroup/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions vendor/github.com/tomcz/gotools/errgroup/doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 85 additions & 0 deletions vendor/github.com/tomcz/gotools/errgroup/panic.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ github.com/russross/blackfriday/v2
# github.com/sirupsen/logrus v1.8.1
## explicit; go 1.13
github.com/sirupsen/logrus
# github.com/tomcz/gotools v0.4.2
## explicit; go 1.19
# github.com/tomcz/gotools v0.4.3
## explicit; go 1.20
github.com/tomcz/gotools/errgroup
github.com/tomcz/gotools/quiet
# github.com/urfave/cli/v2 v2.4.0
## explicit; go 1.11
Expand Down

0 comments on commit 24ad554

Please sign in to comment.