package nstd// MakeSlice makes a slice with the specified length.// Different from the built-in make function, the capacity// of the result slice might be larger than the length.func [ ~[], any]( int) {returnappend((nil), make(, )...)}// MakeSliceWithMinCap makes a slice with capacity not smaller than cap.// The length of the result slice is zero.//// See: https://github.com/golang/go/issues/69872func [ ~[], any]( int) {returnappend((nil), make(, )...)[:0]}type _slice[ ~[], any] []// Slice returns an internal representation of s to do some operations.// Call methods of the internal representation to perform the operations.func [ ~[], any]( ) _slice[, ] {return []()}// Unnamed converts s to unnamed type.func ( _slice[, ]) () [] {return}// Clone clones s and converts the clone result to S.// Different from [slices.Clone], the result of Clone always has equal length and capacity.func ( _slice[, ]) () {var = make([], len())copy(, )return}// RefIter is an iterator which iterates references of elements of s.func ( _slice[, ]) ( func(*, int) bool) {for := range {if !(&[], ) {return } }}
The pages are generated with Goldsv0.7.3. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.