mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
fix(code): remove code that is no longer necessary EE-6078 (#10256)
This commit is contained in:
parent
c748385879
commit
4a39122415
19 changed files with 33 additions and 224 deletions
|
@ -3,48 +3,3 @@ package exec
|
|||
import "regexp"
|
||||
|
||||
var stackNameNormalizeRegex = regexp.MustCompile("[^-_a-z0-9]+")
|
||||
|
||||
type StringSet map[string]bool
|
||||
|
||||
func NewStringSet() StringSet {
|
||||
return make(StringSet)
|
||||
}
|
||||
|
||||
func (s StringSet) Add(x string) {
|
||||
s[x] = true
|
||||
}
|
||||
|
||||
func (s StringSet) Remove(x string) {
|
||||
if s.Contains(x) {
|
||||
delete(s, x)
|
||||
}
|
||||
}
|
||||
|
||||
func (s StringSet) Contains(x string) bool {
|
||||
_, ok := s[x]
|
||||
return ok
|
||||
}
|
||||
|
||||
func (s StringSet) Len() int {
|
||||
return len(s)
|
||||
}
|
||||
|
||||
func (s StringSet) List() []string {
|
||||
list := make([]string, s.Len())
|
||||
|
||||
i := 0
|
||||
for k := range s {
|
||||
list[i] = k
|
||||
i++
|
||||
}
|
||||
|
||||
return list
|
||||
}
|
||||
|
||||
func (s StringSet) Union(x StringSet) {
|
||||
if x.Len() != 0 {
|
||||
for k := range x {
|
||||
s.Add(k)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue