Skip to content

Commit 1d3f770

Browse files
committed
refactor: minor tweaks
1 parent 9e1d7f1 commit 1d3f770

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

cmd/docker-gen/main.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
)
1818

1919
type stringslice []string
20-
type notifyfilter map[string][]string
20+
type mapstringslice map[string][]string
2121

2222
var (
2323
buildVersion string
@@ -28,7 +28,7 @@ var (
2828
notifyOutput bool
2929
notifyContainerID string
3030
notifyContainerSignal int
31-
notifyContainerFilter notifyfilter = make(notifyfilter)
31+
notifyContainerFilter mapstringslice = make(mapstringslice)
3232
onlyExposed bool
3333
onlyPublished bool
3434
includeStopped bool
@@ -53,13 +53,15 @@ func (strings *stringslice) Set(value string) error {
5353
return nil
5454
}
5555

56-
func (filter *notifyfilter) String() string {
56+
func (filter *mapstringslice) String() string {
5757
return "[string][]string"
5858
}
5959

60-
func (filter *notifyfilter) Set(value string) error {
61-
name, value, _ := strings.Cut(value, "=")
62-
(*filter)[name] = append((*filter)[name], value)
60+
func (filter *mapstringslice) Set(value string) error {
61+
name, value, found := strings.Cut(value, "=")
62+
if found {
63+
(*filter)[name] = append((*filter)[name], value)
64+
}
6365
return nil
6466
}
6567

0 commit comments

Comments
 (0)