MCPcopy Create free account
hub / github.com/containerd/nerdctl / InStringSlice

Function InStringSlice

pkg/strutil/strutil.go:63–70  ·  view source on GitHub ↗

InStringSlice checks whether a string is inside a string slice. Comparison is case insensitive. From https://github.com/containerd/containerd/blob/7c6d710bcfc81a30ac1e8cbb2e6a4c294184f7b7/pkg/cri/util/strings.go#L21-L30

(ss []string, str string)

Source from the content-addressed store, hash-verified

61//
62// From https://github.com/containerd/containerd/blob/7c6d710bcfc81a30ac1e8cbb2e6a4c294184f7b7/pkg/cri/util/strings.go#L21-L30
63func InStringSlice(ss []string, str string) bool {
64 for _, s := range ss {
65 if strings.EqualFold(s, str) {
66 return true
67 }
68 }
69 return false
70}
71
72func DedupeStrSlice(in []string) []string {
73 m := make(map[string]struct{})

Callers 13

verifyNetworkTypesFunction · 0.92
JournalLogOptsValidateFunction · 0.92
SyslogOptsValidateFunction · 0.92
JSONFileLogOptsValidateFunction · 0.92
FluentdLogOptsValidateFunction · 0.92
generateCNIPluginsMethod · 0.92
generateCapOptsFunction · 0.92
checkRestartCapabilitiesFunction · 0.92
PruneFunction · 0.92
NewFunction · 0.92
TestRunAddHostFunction · 0.92
printComposeImageIDsFunction · 0.92

Calls

no outgoing calls

Tested by 2

TestRunAddHostFunction · 0.74
TestInStringSliceFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…