diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-06-10 08:42:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-10 08:42:16 -0400 |
commit | 63468464e8365adefebee7127be888ea649edd8e (patch) | |
tree | 1b4d8c8a9af7736f5f4cc813d7897341a3c2b27c /pkg/domain/entities/set.go | |
parent | 9967f28339dc43c97966bc07345af53a374faf67 (diff) | |
parent | 87718c4e676dc503f67ca6f283c4242cf19f9eb7 (diff) | |
download | podman-63468464e8365adefebee7127be888ea649edd8e.tar.gz podman-63468464e8365adefebee7127be888ea649edd8e.tar.bz2 podman-63468464e8365adefebee7127be888ea649edd8e.zip |
Merge pull request #6546 from rhatdan/lint
Turn on golint
Diffstat (limited to 'pkg/domain/entities/set.go')
-rw-r--r-- | pkg/domain/entities/set.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/pkg/domain/entities/set.go b/pkg/domain/entities/set.go index c8d6cb1a9..1d31d82f9 100644 --- a/pkg/domain/entities/set.go +++ b/pkg/domain/entities/set.go @@ -4,12 +4,12 @@ import ( "strings" ) -type stringSet struct { +type StringSet struct { m map[string]struct{} } -func NewStringSet(elem ...string) *stringSet { - s := &stringSet{} +func NewStringSet(elem ...string) *StringSet { + s := &StringSet{} s.m = make(map[string]struct{}, len(elem)) for _, e := range elem { s.Add(e) @@ -17,20 +17,20 @@ func NewStringSet(elem ...string) *stringSet { return s } -func (s *stringSet) Add(elem string) { +func (s *StringSet) Add(elem string) { s.m[elem] = struct{}{} } -func (s *stringSet) Remove(elem string) { +func (s *StringSet) Remove(elem string) { delete(s.m, elem) } -func (s *stringSet) Contains(elem string) bool { +func (s *StringSet) Contains(elem string) bool { _, ok := s.m[elem] return ok } -func (s *stringSet) Elements() []string { +func (s *StringSet) Elements() []string { keys := make([]string, len(s.m)) i := 0 for k := range s.m { @@ -40,6 +40,6 @@ func (s *stringSet) Elements() []string { return keys } -func (s *stringSet) String() string { +func (s *StringSet) String() string { return strings.Join(s.Elements(), ", ") } |