Documentation
¶
Index ¶
- Constants
- func E[T any](_ T, err error) error
- func Filter[T any](old []T, f func(item T) bool) []T
- func Find[T any](s []T, t T, compare func(a, b T) bool) int
- func Has[T any](s []T, t T, compare func(a, b T) bool) bool
- func Include[T comparable](s []T, t T) bool
- func Index[T comparable](s []T, t T) int
- func Interfaces[T any](objs []T) []interface{}
- func JSONStringer(v any) fmt.Stringer
- func Limit[T any](s []T, limit int, hidePosition int, manySuffix ...T) []T
- func M[T any](v T, err error) T
- func Map[S any, T any](old []S, f func(item S) T) []T
- func NewStringer(stringer func() string) fmt.Stringer
- func P[T any](o T) *T
- func StringEqual(a, b string) bool
- type OneOrMore
- type Stringer
Constants ¶
View Source
const ( PosRight = iota PosLeft PosCenter )
Variables ¶
This section is empty.
Functions ¶
func Include ¶
func Include[T comparable](s []T, t T) bool
func Index ¶
func Index[T comparable](s []T, t T) int
func Interfaces ¶
func Interfaces[T any](objs []T) []interface{}
func JSONStringer ¶
func NewStringer ¶
func StringEqual ¶ added in v1.1.2
Types ¶
type OneOrMore ¶ added in v1.1.2
type OneOrMore[T comparable] []T
OneOrMore represents a value that can either be a string or an array of strings. Mainly here for serialization purposes
func (OneOrMore[T]) Contains ¶ added in v1.1.2
Contains returns true when the value is contained in the slice
func (OneOrMore[T]) MarshalJSON ¶ added in v1.1.2
MarshalJSON converts this string or array to a JSON array or JSON string
func (OneOrMore[T]) MarshalYAML ¶ added in v1.1.2
func (*OneOrMore[T]) UnmarshalJSON ¶ added in v1.1.2
UnmarshalJSON unmarshals this string or array object from a JSON array or signal JSON value
Click to show internal directories.
Click to hide internal directories.