Documentation
¶
Index ¶
- Variables
- func AllColsInList(cols []string, lists ...[]string) bool
- func Delete(from, to int) deleteRule
- func EditCallback(rule EditRule, callbacks ...func(start, end int, before, after string) error) callbackRule
- func EditString(s string, rules ...EditRule) (string, error)
- func EditStringSegment(s string, from, to int, rules ...EditRule) (string, error)
- func Except[T comparable](src []T, excludes ...T) []T
- func FilterNonZero[T comparable](s []T) []T
- func FirstNonEmpty[T comparable, Ts ~[]T](slice Ts) T
- func Insert(pos int, content string) insertRule
- func InsertFromFunc(pos int, content func() string) insertRule
- func Only[T comparable](src []T, includes ...T) []T
- func Pointer[T any](val T) *T
- func RandInt() int64
- func RemoveDuplicates[T comparable, Ts ~[]T](slice Ts) Ts
- func Replace(from, to int, content string) replaceRule
- func ReplaceFromFunc(from, to int, content func() string) replaceRule
- func SliceMatch[T comparable, Ts ~[]T](a, b Ts) bool
- func ToAnySlice[T any, Ts ~[]T](slice Ts) []any
- func ValOrZero[T comparable](val *T) T
- type EditRule
- type OutOfBoundsError
- type RuleType
Constants ¶
This section is empty.
Variables ¶
View Source
var TypesReplacer = strings.NewReplacer(
" ", "_",
".", "_",
",", "_",
"*", "_",
"[", "_",
"]", "_",
)
Functions ¶
func AllColsInList ¶
Check if any one of the lists contains all the columns
func EditCallback ¶
func EditStringSegment ¶
func Except ¶
func Except[T comparable](src []T, excludes ...T) []T
Except drops the given column names from the column set
func FilterNonZero ¶
func FilterNonZero[T comparable](s []T) []T
func FirstNonEmpty ¶
func FirstNonEmpty[T comparable, Ts ~[]T](slice Ts) T
func InsertFromFunc ¶
func Only ¶
func Only[T comparable](src []T, includes ...T) []T
Only drops other column names from the column set
func RemoveDuplicates ¶
func RemoveDuplicates[T comparable, Ts ~[]T](slice Ts) Ts
func ReplaceFromFunc ¶
func SliceMatch ¶
func SliceMatch[T comparable, Ts ~[]T](a, b Ts) bool
func ToAnySlice ¶
func ValOrZero ¶
func ValOrZero[T comparable](val *T) T
Types ¶
type OutOfBoundsError ¶
type OutOfBoundsError int
func (OutOfBoundsError) Error ¶
func (e OutOfBoundsError) Error() string
func (OutOfBoundsError) Is ¶
func (e OutOfBoundsError) Is(target error) bool
Click to show internal directories.
Click to hide internal directories.