github.com/AliyunContainerService/cli@v0.0.0-20181009023821-814ced4b30d0/kubernetes/compose/clone/slices.go (about)

     1  package clone
     2  
     3  // SliceOfString deep copy a slice of strings
     4  func SliceOfString(source []string) []string {
     5  	if source == nil {
     6  		return nil
     7  	}
     8  	res := make([]string, len(source))
     9  	copy(res, source)
    10  	return res
    11  }