utils

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BugPanic added in v0.0.6

func BugPanic(message string)

func Exists

func Exists(filePath string) (bool, error)

func Filter added in v0.1.0

func Filter[T any](slice []T, filterFunc func(T) bool) []T

Types

type Set added in v0.0.6

type Set[T comparable] struct {
	// contains filtered or unexported fields
}

func NewSet added in v0.0.6

func NewSet[T comparable]() Set[T]

func (Set[T]) Add added in v0.0.6

func (s Set[T]) Add(v ...T)

func (Set[T]) All added in v0.0.6

func (s Set[T]) All() []T

func (Set[T]) Contains added in v0.0.6

func (s Set[T]) Contains(v T) bool

func (Set[T]) Remove added in v0.0.6

func (s Set[T]) Remove(v ...T)

type Slice added in v0.1.0

type Slice[T any] struct {
	// contains filtered or unexported fields
}

func NewSlice added in v0.1.0

func NewSlice[T any](equalFunc func(a, b T) bool) Slice[T]

func (Slice[T]) AppendIfNotExist added in v0.1.0

func (s Slice[T]) AppendIfNotExist(slice []T, v ...T) []T

func (Slice[T]) Contains added in v0.1.0

func (s Slice[T]) Contains(slice []T, v T) bool

func (Slice[T]) Index added in v0.1.0

func (s Slice[T]) Index(slice []T, v T) int

Jump to

Keyboard shortcuts

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