Documentation
¶
Index ¶
- Constants
- func CompareValue(x any, y any) bool
- func GetValue(v interface{}) interface{}
- func IsFalse(value any) bool
- func IsMap(v interface{}) bool
- func IsNil(v any) bool
- func IsPointer(v interface{}) bool
- func IsSlice(v interface{}) bool
- func IsStruct(v interface{}) bool
- func IsTrue(value any) bool
- func MustParseInt(s string) int64
- func Ptr[T interface{}](value T) *T
- type List
- func (list *List[T]) All(predicate func(T) bool) bool
- func (list *List[T]) Any(predicate func(T) bool) bool
- func (list *List[T]) Append(value T, unique bool) *List[T]
- func (list *List[T]) Clear() *List[T]
- func (list List[T]) Concat(other List[T]) List[T]
- func (list *List[T]) Contains(values ...T) bool
- func (list *List[T]) ContainsAny(values ...T) bool
- func (list *List[T]) Filter(predicate func(T) bool) *List[T]
- func (list *List[T]) Find(predicate func(T) bool) *T
- func (list *List[T]) FindIndex(predicate func(T) bool) int
- func (list *List[T]) FindLastIndex(predicate func(T) bool) int
- func (list *List[T]) First() *T
- func (list *List[T]) ForEach(action func(int, T))
- func (list List[T]) GroupBy(keySelector func(T) string) map[string][]T
- func (list *List[T]) Index(value T) int
- func (list *List[T]) Insert(index int, values ...T) *List[T]
- func (list *List[T]) Last() *T
- func (list *List[T]) LastIndex(value T) int
- func (list *List[T]) Len() int
- func (list *List[T]) MapString(mapper func(int, T) string) []string
- func (list *List[T]) Remove(value T) *List[T]
- func (list *List[T]) RemoveAt(index int) *List[T]
- func (list *List[T]) Reverse() *List[T]
- func (list List[T]) Slice(startIndex, endIndex int) List[T]
- func (list *List[T]) Sort(less func(T, T) bool)
- func (list *List[T]) ToSlice() []T
- func (list *List[T]) Unique() *List[T]
- type M
- type Map
- type Number
- type OSPath
- func (p OSPath) Exists() bool
- func (p OSPath) FileInfo() (os.FileInfo, error)
- func (p OSPath) FileType() (string, error)
- func (p OSPath) Glob(pattern string) ([]string, error)
- func (p OSPath) HasPrefix(prefix ...string) bool
- func (p OSPath) HasSuffix(suffix ...string) bool
- func (p OSPath) IsDir() bool
- func (p OSPath) IsFile() bool
- func (p OSPath) IsSymlink() bool
- func (p OSPath) Join(paths ...string) OSPath
- func (p OSPath) Mkdir(perm fs.FileMode) error
- func (p OSPath) Open() (fs.File, error)
- func (p OSPath) ReadAll() ([]byte, error)
- func (p OSPath) ReadByteLine(fn func(bytes []byte, err error)) error
- func (p OSPath) ReadLine(fn func(line string, err error)) error
- func (p OSPath) ReadString() (string, error)
- func (p OSPath) Remove() error
- func (p OSPath) RemoveAll() error
- func (p OSPath) String() string
- func (p OSPath) Walk(fn func(path OSPath, info fs.FileInfo, err error) error) error
- func (p OSPath) Zip(output string) error
Constants ¶
View Source
const OSDir = 2
View Source
const OSFile = 1
View Source
const OSUnknown = 0
Variables ¶
This section is empty.
Functions ¶
func MustParseInt ¶ added in v1.0.1
Types ¶
type List ¶
type List[T comparable] struct { // contains filtered or unexported fields }
func ListOf ¶
func ListOf[T comparable](items ...T) *List[T]
func (*List[T]) FindLastIndex ¶
反向查找符合条件的元素索引
type OSPath ¶
type OSPath struct {
// contains filtered or unexported fields
}
func (OSPath) ReadByteLine ¶
按行读取文件
func (OSPath) ReadString ¶
func (OSPath) RemoveAll ¶
RemoveAll removes path and any children it contains. It removes everything it can but returns the first error it encounters. If the path does not exist, RemoveAll returns nil (no error). If there is an error, it will be of type *PathError.
Click to show internal directories.
Click to hide internal directories.