util

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsFloat32

func AbsFloat32(f float32) float32

func ByteToString

func ByteToString(b []byte) string

func ExtractAndBeautifyJSON

func ExtractAndBeautifyJSON(input string) (string, error)

func GetLines

func GetLines(filePath string, m, n int) ([]string, error)

func Map

func Map[T any, U any](src []T, f func(T) U) []U

func StringToByte

func StringToByte(s string) []byte

func ToElem

func ToElem[T any](v *T) T

func ToPtr

func ToPtr[T any](v T) *T

func UnzipFile

func UnzipFile(zipPath, destDir string) error

func ZipFile

func ZipFile(srcDir, zipPath string) error

Types

type SafeMap

type SafeMap[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func NewSafeMap

func NewSafeMap[K comparable, V any]() *SafeMap[K, V]

func (*SafeMap[K, V]) Delete

func (sm *SafeMap[K, V]) Delete(key K)

func (*SafeMap[K, V]) Get

func (sm *SafeMap[K, V]) Get(key K) V

func (*SafeMap[K, V]) GetOk

func (sm *SafeMap[K, V]) GetOk(key K) (V, bool)

func (*SafeMap[K, V]) Set

func (sm *SafeMap[K, V]) Set(key K, value V)

func (*SafeMap[K, V]) Snapshot

func (sm *SafeMap[K, V]) Snapshot() map[K]V

type SafeSet

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

func NewSafeSet

func NewSafeSet[T comparable]() *SafeSet[T]

func (*SafeSet[T]) Add

func (ss *SafeSet[T]) Add(val T)

func (*SafeSet[T]) Drop

func (ss *SafeSet[T]) Drop(vals []T)

func (*SafeSet[T]) Len

func (ss *SafeSet[T]) Len() int

func (*SafeSet[T]) Range

func (ss *SafeSet[T]) Range(f func(T) bool) []T

func (*SafeSet[T]) Truncate

func (ss *SafeSet[T]) Truncate()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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