gitlab.com/evatix-go/core@v1.3.55/coredata/stringslice/AnyItemsCloneUsingCap.go (about)

     1  package stringslice
     2  
     3  func AnyItemsCloneUsingCap(
     4  	newAdditionalCap int,
     5  	slice []interface{},
     6  ) []interface{} {
     7  	newSlice := make(
     8  		[]interface{},
     9  		0,
    10  		newAdditionalCap+len(slice))
    11  
    12  	if len(slice) == 0 {
    13  		return newSlice
    14  	}
    15  
    16  	newSlice = append(newSlice, slice...)
    17  
    18  	return newSlice
    19  }