util

package
v1.0.79 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FastRand added in v1.0.40

func FastRand(n int) int

func ParallelKeys

func ParallelKeys[K comparable, V any](maxp int, p map[K]V, fn func(k K))

func ParallelVals

func ParallelVals[K comparable, V any](maxp int, p map[K]V, fn func(k V))

func RandomBytes added in v1.0.40

func RandomBytes() []byte

func Shuffle added in v1.0.40

func Shuffle(n int, swap func(i, j int))

func ToFloat32

func ToFloat32(s string) (float32, error)

func ToFloat64

func ToFloat64(s string) (float64, error)

Types

type Container added in v1.0.10

type Container interface {
	Capacity() int
	ResetLen(n int)
}

type Pool added in v1.0.10

type Pool[T Container] struct {
	// contains filtered or unexported fields
}

func NewPool added in v1.0.10

func NewPool[T Container](fn func(capacity int) T) *Pool[T]

func (*Pool[T]) Get added in v1.0.10

func (p *Pool[T]) Get(length, capacity int) T

func (*Pool[T]) Put added in v1.0.10

func (p *Pool[T]) Put(s T)

Jump to

Keyboard shortcuts

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