Skip to content

Commit

Permalink
refactor: function in stdlib now
Browse files Browse the repository at this point in the history
Signed-off-by: emirot <emirot.nolan@gmail.com>
  • Loading branch information
emirot committed May 3, 2024
1 parent 49a645f commit f983846
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions kustomize/commands/edit/fix/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func constructFieldOptions(value string, varString string) ([]*types.FieldOption
return nil, fmt.Errorf("cannot convert all vars to replacements; %s is not delimited", varString)
}
delimiter = pre
index = indexOf(varString, strings.Split(value, delimiter))
index = slices.Index(strings.Split(value, delimiter), varString)
if index == -1 {
// this should never happen
return nil, fmt.Errorf("internal error: could not get index of var %s", varString)
Expand Down Expand Up @@ -328,12 +328,3 @@ func setPlaceholderValue(varName string, files []string, fSys filesys.FileSystem
}
return nil
}

func indexOf(varName string, slice []string) int {
for i := range slice {
if slice[i] == varName {
return i
}
}
return -1
}

0 comments on commit f983846

Please sign in to comment.