Registry / utility / bradfitz-slice

bradfitz-slice

JSON →
library0.0.0-20180809154707-2b758aa73013gogounverified

Package slice provides utility functions for sorting and manipulating slices in Go.

go get github.com/bradfitz/slice
INSTALL
IMPORT
SIG · BRADFITZ-SLICE
B
bradfitz-slice
utilitygov0.0.0-20180809154707-2b758aa73013
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

slice
github.com/bradfitz/slice

Sort a slice using a custom less function

package main import ( "fmt" "github.com/bradfitz/slice" ) func main() { s := []int{3, 1, 4, 1, 5, 9} slice.Sort(s, func(i, j int) bool { return s[i] < s[j] }) fmt.Println(s) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.0.0-20180809154707-2b758aa73013latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
bradfitz-slice — go get bradfitz-slice · libregistry