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

Commit 24ad554

Browse files
committed
use panic handling errgroup from gotools
1 parent 6b5fb51 commit 24ad554

File tree

7 files changed

+105
-8
lines changed

7 files changed

+105
-8
lines changed

cmd/openldap_exporter/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010
exporter "github.com/tomcz/openldap_exporter"
1111

1212
log "github.com/sirupsen/logrus"
13+
"github.com/tomcz/gotools/errgroup"
1314
"github.com/urfave/cli/v2"
1415
"github.com/urfave/cli/v2/altsrc"
15-
"golang.org/x/sync/errgroup"
1616
)
1717

1818
const (
@@ -140,7 +140,7 @@ func runMain(c *cli.Context) error {
140140
}
141141

142142
ctx, cancel := context.WithCancel(context.Background())
143-
var group errgroup.Group
143+
group := errgroup.New()
144144
group.Go(func() error {
145145
defer cancel()
146146
return server.Start()

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ require (
77
github.com/prometheus/client_golang v1.12.1
88
github.com/prometheus/exporter-toolkit v0.7.3
99
github.com/sirupsen/logrus v1.8.1
10-
github.com/tomcz/gotools v0.4.2
10+
github.com/tomcz/gotools v0.4.3
1111
github.com/urfave/cli/v2 v2.4.0
12-
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
1312
gopkg.in/ldap.v2 v2.5.1
1413
)
1514

@@ -31,6 +30,7 @@ require (
3130
golang.org/x/crypto v0.1.0 // indirect
3231
golang.org/x/net v0.7.0 // indirect
3332
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c // indirect
33+
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
3434
golang.org/x/sys v0.5.0 // indirect
3535
golang.org/x/text v0.7.0 // indirect
3636
google.golang.org/appengine v1.6.6 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf
208208
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
209209
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
210210
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
211-
github.com/tomcz/gotools v0.4.2 h1:bforF32o12uGyJH1sJPMAkI/XeGaGylwk0XC4wKgOf8=
212-
github.com/tomcz/gotools v0.4.2/go.mod h1:SYLitf1gefAO8soXL4ueN+z5IrkEv18Nb0W2hoOi/+s=
211+
github.com/tomcz/gotools v0.4.3 h1:HDp2xf+V4QLBDUTITyRg3iT6xdNctOFyuD8UGtNYRxA=
212+
github.com/tomcz/gotools v0.4.3/go.mod h1:XpogqLWZanpKfo+a2YEvtdKy1zmYVrjpMYRAzHVebD4=
213213
github.com/urfave/cli/v2 v2.4.0 h1:m2pxjjDFgDxSPtO8WSdbndj17Wu2y8vOT86wE/tjr+I=
214214
github.com/urfave/cli/v2 v2.4.0/go.mod h1:NX9W0zmTvedE5oDoOMs2RTC8RvdK98NTYZE5LbaEYPg=
215215
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=

vendor/github.com/tomcz/gotools/errgroup/README.md

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/tomcz/gotools/errgroup/doc.go

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/tomcz/gotools/errgroup/panic.go

Lines changed: 85 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ github.com/russross/blackfriday/v2
6464
# github.com/sirupsen/logrus v1.8.1
6565
## explicit; go 1.13
6666
github.com/sirupsen/logrus
67-
# github.com/tomcz/gotools v0.4.2
68-
## explicit; go 1.19
67+
# github.com/tomcz/gotools v0.4.3
68+
## explicit; go 1.20
69+
github.com/tomcz/gotools/errgroup
6970
github.com/tomcz/gotools/quiet
7071
# github.com/urfave/cli/v2 v2.4.0
7172
## explicit; go 1.11

0 commit comments

Comments
 (0)