Skip to content

Commit

Permalink
copy array
Browse files Browse the repository at this point in the history
  • Loading branch information
hilmarf committed Feb 23, 2024
1 parent 5141e5b commit 51d117b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/cobrautils/flag/path_array.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ func (s *pathArrayValue) Replace(val []string) error {

func (s *pathArrayValue) GetSlice() []string {
out := make([]string, len(*s.value))
for i, d := range *s.value {
out[i] = d
}
copy(out, *s.value)
return out
}

Expand All @@ -73,7 +71,7 @@ func pathArrayConv(sval []string) []string {
return sval
}

// pathStringListConv converts a string containing multiple filepaths seperated by filepath.ListSeparator into a list
// pathStringListConv converts a string containing multiple filepaths separated by filepath.ListSeparator into a list
// of filepaths.
func pathStringListConv(sval string) []string {
values := filepath.SplitList(sval)
Expand Down

0 comments on commit 51d117b

Please sign in to comment.