summaryrefslogtreecommitdiff
path: root/pkg/util
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-05-23 12:16:49 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2022-05-23 12:16:54 -0400
commit5d37d80ff9783b2c811a06d80cd06fd6e338faf0 (patch)
tree3efc472f3dde96ce2ce43992bc45fa31d9f805cf /pkg/util
parent7d00b0ea0d0c53ddba8d6aebdbce2f167aceccc5 (diff)
downloadpodman-5d37d80ff9783b2c811a06d80cd06fd6e338faf0.tar.gz
podman-5d37d80ff9783b2c811a06d80cd06fd6e338faf0.tar.bz2
podman-5d37d80ff9783b2c811a06d80cd06fd6e338faf0.zip
Use containers/common/pkg/util.StringToSlice
[NO NEW TESTS NEEDED] Just code cleanup for better reuse Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/util')
-rw-r--r--pkg/util/utils.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/pkg/util/utils.go b/pkg/util/utils.go
index a0bf8b50d..1b7663330 100644
--- a/pkg/util/utils.go
+++ b/pkg/util/utils.go
@@ -17,6 +17,7 @@ import (
"github.com/BurntSushi/toml"
"github.com/containers/common/pkg/config"
+ "github.com/containers/common/pkg/util"
"github.com/containers/image/v5/types"
"github.com/containers/podman/v4/pkg/errorhandling"
"github.com/containers/podman/v4/pkg/namespaces"
@@ -78,14 +79,9 @@ func ParseRegistryCreds(creds string) (*types.DockerAuthConfig, error) {
}, nil
}
-// StringInSlice determines if a string is in a string slice, returns bool
+// StringInSlice is depracated, use containers/common/pkg/util/StringInSlice
func StringInSlice(s string, sl []string) bool {
- for _, i := range sl {
- if i == s {
- return true
- }
- }
- return false
+ return util.StringInSlice(s, sl)
}
// StringMatchRegexSlice determines if a given string matches one of the given regexes, returns bool