github.com/prebid/prebid-server/v2@v2.18.0/util/sliceutil/clone.go (about)

     1  package sliceutil
     2  
     3  func Clone[T any](s []T) []T {
     4  	if s == nil {
     5  		return nil
     6  	}
     7  
     8  	c := make([]T, len(s), cap(s))
     9  	copy(c, s)
    10  
    11  	return c
    12  }