mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-10 10:53:36 +02:00
fix(lint): improve styling and fix lint errors
This commit is contained in:
@@ -17,7 +17,7 @@ func initConfigDirWatcher() {
|
||||
configDirWatcher = NewDirectoryWatcher(t, common.ConfigBasePath)
|
||||
}
|
||||
|
||||
// create a new file watcher for file under ConfigBasePath.
|
||||
// NewConfigFileWatcher creates a new file watcher for file under common.ConfigBasePath.
|
||||
func NewConfigFileWatcher(filename string) Watcher {
|
||||
configDirWatcherInitOnce.Do(initConfigDirWatcher)
|
||||
return configDirWatcher.Add(filename)
|
||||
|
||||
@@ -124,15 +124,13 @@ func (w DockerWatcher) EventsWithOptions(ctx context.Context, options DockerList
|
||||
|
||||
retry := time.NewTicker(dockerWatcherRetryInterval)
|
||||
defer retry.Stop()
|
||||
ok := false
|
||||
outer:
|
||||
for !ok {
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case <-retry.C:
|
||||
if checkConnection(ctx, client) {
|
||||
ok = true
|
||||
break outer
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package events
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"maps"
|
||||
|
||||
dockerEvents "github.com/moby/moby/api/types/events"
|
||||
)
|
||||
@@ -69,9 +70,7 @@ var actionNameMap = func() (m map[Action]string) {
|
||||
for k, v := range DockerEventMap {
|
||||
m[v] = string(k)
|
||||
}
|
||||
for k, v := range fileActionNameMap {
|
||||
m[k] = v
|
||||
}
|
||||
maps.Copy(m, fileActionNameMap)
|
||||
return m
|
||||
}()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user