Skip to content

Commit 6d765f2

Browse files
committed
format code using gofumpt with no extra parameters, just for fun
1 parent 4796e1b commit 6d765f2

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

kafka_exporter.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ func (e *Exporter) collectChans(quit chan struct{}) {
385385
}
386386

387387
func (e *Exporter) collect(ch chan<- prometheus.Metric) {
388-
var wg = sync.WaitGroup{}
388+
wg := sync.WaitGroup{}
389389
ch <- prometheus.MustNewConstMetric(
390390
clusterBrokers, prometheus.GaugeValue, float64(len(e.client.Brokers())),
391391
)
@@ -506,7 +506,6 @@ func (e *Exporter) collect(ch chan<- prometheus.Metric) {
506506

507507
if e.useZooKeeperLag {
508508
ConsumerGroups, err := e.zookeeperClient.Consumergroups()
509-
510509
if err != nil {
511510
klog.Errorf("Cannot get consumer group %v", err)
512511
}

scram_client.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ import (
88
"github.com/xdg-go/scram"
99
)
1010

11-
var SHA256 scram.HashGeneratorFcn = func() hash.Hash { return sha256.New() }
12-
var SHA512 scram.HashGeneratorFcn = func() hash.Hash { return sha512.New() }
11+
var (
12+
SHA256 scram.HashGeneratorFcn = func() hash.Hash { return sha256.New() }
13+
SHA512 scram.HashGeneratorFcn = func() hash.Hash { return sha512.New() }
14+
)
1315

1416
type XDGSCRAMClient struct {
1517
*scram.Client

simple_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func assumeKafka() bool {
4747
}
4848

4949
func execute(handler func(response *http.Response)) {
50-
var e = errors.New("dummy")
50+
e := errors.New("dummy")
5151
for e != nil {
5252
resp, err := http.Get("http://localhost:9304/metrics")
5353
if err != nil {

0 commit comments

Comments
 (0)