summaryrefslogtreecommitdiff
path: root/pkg/domain/entities/set.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-06-09 20:45:51 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2020-06-10 05:49:41 -0400
commit87718c4e676dc503f67ca6f283c4242cf19f9eb7 (patch)
treefab6dcb9e6c497cb1155b864bcc2085550d23969 /pkg/domain/entities/set.go
parent4bb43b898d72cb938d317055e4ade2771cfc9c54 (diff)
downloadpodman-87718c4e676dc503f67ca6f283c4242cf19f9eb7.tar.gz
podman-87718c4e676dc503f67ca6f283c4242cf19f9eb7.tar.bz2
podman-87718c4e676dc503f67ca6f283c4242cf19f9eb7.zip
Fix Id->ID where possible for lint
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/domain/entities/set.go')
-rw-r--r--pkg/domain/entities/set.go16
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(), ", ")
}