Source File
util.go
Belonging Package
charm.land/lipgloss/v2/table
package tableimport ()// btoi converts a boolean to an integer, 1 if true, 0 if false.func ( bool) int {if {return 1}return 0}// bton converts a boolean to a specific integer, n if true, 0 if false.func ( bool, int) int {if {return}return 0}// sum returns the sum of all integers in a slice.func ( []int) int {var intfor , := range {+=}return}// median returns the median of a slice of integers.func ( []int) int {sort.Ints()if len() <= 0 {return 0}if len()%2 == 0 {:= len() / 2 //nolint:mndreturn ([-1] + []) / 2 //nolint:mnd}return [len()/2]}
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64)