common

package
v0.0.0-...-d3bc976 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2023 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const UnsafeBuffer = runtime.GOOS != "windows"

Variables

This section is empty.

Functions

func All

func All[T any](array []T, block func(it T) bool) bool

func AllIndexed

func AllIndexed[T any](array []T, block func(index int, it T) bool) bool

func Any

func Any[T any](array []T, block func(it T) bool) bool

func AnyError deprecated

func AnyError(errs ...error) error

Deprecated: use E.Errors

func AnyIndexed

func AnyIndexed[T any](array []T, block func(index int, it T) bool) bool

func Cast

func Cast[T any](obj any) (T, bool)

func Close

func Close(closers ...any) error

func Contains

func Contains[T comparable](arr []T, target T) bool

func DefaultValue

func DefaultValue[T any]() T

func Done

func Done(ctx context.Context) bool

func Dup

func Dup[T any](obj T) T

func Error

func Error(_ any, err error) error

func Filter

func Filter[T any](arr []T, block func(it T) bool) []T

func FilterIndexed

func FilterIndexed[T any](arr []T, block func(index int, it T) bool) []T

func FilterIsInstance

func FilterIsInstance[T any, N any](arr []T, block func(it T) (N, bool)) []N

func FilterNotDefault

func FilterNotDefault[T comparable](arr []T) []T

func FilterNotNil

func FilterNotNil[T any](arr []T) []T

func Find

func Find[T any](arr []T, block func(it T) bool) T

func GetFileDescriptor

func GetFileDescriptor(conn syscall.Conn) (uintptr, error)

func IsEmpty

func IsEmpty[T comparable](obj T) bool

func KeepAlive

func KeepAlive(obj any)

func Map

func Map[T any, N any](arr []T, block func(it T) N) []N

func MapIndexed

func MapIndexed[T any, N any](arr []T, block func(index int, it T) N) []N

func Must

func Must(errs ...error)

func Must1

func Must1(_ any, err error)

func Must2

func Must2(_, _ any, err error)

func PtrOrNil

func PtrOrNil[T any](ptr *T) any

func PtrValueOrDefault

func PtrValueOrDefault[T any](ptr *T) T

func Reverse

func Reverse[T any](arr []T) []T

func Start

func Start(starters ...any) error

func Uniq

func Uniq[T comparable](arr []T) []T

func UniqBy

func UniqBy[T any, C comparable](arr []T, block func(it T) C) []T

Types

type Starter

type Starter interface {
	Start() error
}

type WithUpstream

type WithUpstream interface {
	Upstream() any
}

Directories

Path Synopsis
x
list
Package list implements a doubly linked list.
Package list implements a doubly linked list.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL