Skip to content

Commit dff8387

Browse files
committed
go vet fix: range variable config enclosed by function
1 parent 940fd42 commit dff8387

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docker-gen.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ func generateAtInterval(client *docker.Client, configs ConfigFile) {
275275
wg.Add(1)
276276
ticker := time.NewTicker(time.Duration(config.Interval) * time.Second)
277277
quit := make(chan struct{})
278+
configCopy := config
278279
go func() {
279280
for {
280281
select {
@@ -285,8 +286,8 @@ func generateAtInterval(client *docker.Client, configs ConfigFile) {
285286
continue
286287
}
287288
// ignore changed return value. always run notify command
288-
generateFile(config, containers)
289-
runNotifyCmd(config)
289+
generateFile(configCopy, containers)
290+
runNotifyCmd(configCopy)
290291
case <-quit:
291292
ticker.Stop()
292293
return

0 commit comments

Comments
 (0)