MCPcopy Create free account
hub / github.com/zalando/postgres-operator / RemoveString

Function RemoveString

pkg/util/util.go:156–164  ·  view source on GitHub ↗

Iterate through slice and remove certain string, then return cleaned slice

(slice []string, s string)

Source from the content-addressed store, hash-verified

154
155// Iterate through slice and remove certain string, then return cleaned slice
156func RemoveString(slice []string, s string) (result []string) {
157 for _, item := range slice {
158 if item == s {
159 continue
160 }
161 result = append(result, item)
162 }
163 return result
164}
165
166// SliceReplaceElement
167func StringSliceReplaceElement(s []string, a, b string) (result []string) {

Callers 2

removeFinalizerMethod · 0.92
TestRemoveStringFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestRemoveStringFunction · 0.68