Skip to content

Commit

Permalink
[publisher] Use slices contains
Browse files Browse the repository at this point in the history
  • Loading branch information
IceflowRE committed Oct 3, 2023
1 parent 7cfe13c commit dc618aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
3 changes: 2 additions & 1 deletion publisher/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"log"
"os"
"path/filepath"
"slices"
)

func main() {
Expand Down Expand Up @@ -42,7 +43,7 @@ func iterDirectories(baseDir string, addons []string) error {
if !dir.IsDir() {
continue
}
if len(addons) != 0 && !contains(addons, dir.Name()) {
if len(addons) != 0 && !slices.Contains(addons, dir.Name()) {
continue
}
addonCfg := newAddonConfig(dir.Name(), baseDir)
Expand Down
9 changes: 0 additions & 9 deletions publisher/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,3 @@ func zipFile(zw *zip.Writer, src string, dest string) error {
_, err = io.Copy(zf, file)
return err
}

func contains[T comparable](elems []T, v T) bool {
for _, s := range elems {
if v == s {
return true
}
}
return false
}

0 comments on commit dc618aa

Please sign in to comment.