Skip to content

Commit

Permalink
Use copy
Browse files Browse the repository at this point in the history
  • Loading branch information
ncabatoff committed Feb 6, 2024
1 parent 36c63a9 commit 61255fb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions strutil/strutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ func ParseKeyValues(input string, out map[string]string, sep string) error {

// ParseArbitraryKeyValues parses arbitrary <key,value> tuples. The input
// can be one of the following:
// * JSON string
// * Base64 encoded JSON string
// * Comma separated list of `<key>=<value>` pairs
// * Base64 encoded string containing comma separated list of
// `<key>=<value>` pairs
// - JSON string
// - Base64 encoded JSON string
// - Comma separated list of `<key>=<value>` pairs
// - Base64 encoded string containing comma separated list of
// `<key>=<value>` pairs
//
// Input will be parsed into the output parameter, which should
// be a non-nil map[string]string.
Expand Down Expand Up @@ -371,7 +371,7 @@ func StrListDelete(s []string, d string) []string {
// result in confusing behaviour, see https://go.dev/play/p/EAtNw4lLugu
c := make([]string, len(s))
copy(c, s)
return append(s[:index], s[index+1:]...)
return append(c[:index], c[index+1:]...)
}
}

Expand Down

0 comments on commit 61255fb

Please sign in to comment.