Documentation ¶ Overview ¶ Package ranking owns exact bounded selection utilities. Index ¶ func TopK[T any](values []T, k int, better func(a, b T) bool) []T Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func TopK ¶ func TopK[T any](values []T, k int, better func(a, b T) bool) []T TopK returns the first k values under better without mutating the input. Better must define a strict total order and return true when a ranks before b. Types ¶ This section is empty. Source Files ¶ View all Source files topk.go Click to show internal directories. Click to hide internal directories.