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 ¶ added in v0.29.0
Check if any one of the lists contains all the columns
func EditCallback ¶ added in v0.32.0
func EditStringSegment ¶ added in v0.32.0
func Except ¶ added in v0.40.0
func Except[T comparable](src []T, excludes ...T) []T
Except drops the given column names from the column set
func FilterNonZero ¶ added in v0.15.0
func FilterNonZero[T comparable](s []T) []T
func FirstNonEmpty ¶ added in v0.15.0
func FirstNonEmpty[T comparable, Ts ~[]T](slice Ts) T
func InsertFromFunc ¶ added in v0.32.0
func Only ¶ added in v0.40.0
func Only[T comparable](src []T, includes ...T) []T
Only drops other column names from the column set
func RemoveDuplicates ¶ added in v0.29.0
func RemoveDuplicates[T comparable, Ts ~[]T](slice Ts) Ts
func ReplaceFromFunc ¶ added in v0.32.0
func SliceMatch ¶ added in v0.29.0
func SliceMatch[T comparable, Ts ~[]T](a, b Ts) bool
func ToAnySlice ¶ added in v0.15.0
func ValOrZero ¶ added in v0.40.0
func ValOrZero[T comparable](val *T) T
Types ¶
type EditRule ¶ added in v0.32.0
type EditRule interface {
// contains filtered or unexported methods
}
func RecordPoint ¶ added in v0.41.1
type OutOfBoundsError ¶ added in v0.32.0
type OutOfBoundsError int
func (OutOfBoundsError) Error ¶ added in v0.32.0
func (e OutOfBoundsError) Error() string
func (OutOfBoundsError) Is ¶ added in v0.32.0
func (e OutOfBoundsError) Is(target error) bool
Click to show internal directories.
Click to hide internal directories.