You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
213 B
Go
12 lines
213 B
Go
6 years ago
|
package clone
|
||
|
|
||
|
// SliceOfString deep copy a slice of strings
|
||
|
func SliceOfString(source []string) []string {
|
||
|
if source == nil {
|
||
|
return nil
|
||
|
}
|
||
|
res := make([]string, len(source))
|
||
|
copy(res, source)
|
||
|
return res
|
||
|
}
|