utils

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: MIT Imports: 7 Imported by: 19

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvIntPtr

func ConvIntPtr[A, B constraints.Integer](a *A) *B

ConvIntPtr converts an integer pointer to another type

func ConvertNonce

func ConvertNonce(nonce []byte) *uint64

func IdPtr

func IdPtr[T any](value T) *T

IdPtr is the pointer version of id: 'a->'a

func MakeTimestamp

func MakeTimestamp(t time.Time) uint64

func Max

func Max[T constraints.Ordered](a, b T) T

func Min

func Min[T constraints.Ordered](a, b T) T

func SetTestingT

func SetTestingT(t *testing.T)

func WithErr

func WithErr[T any](_ T, err error) error

func WithoutErr

func WithoutErr[T any](v T, err error) T

Types

type CmdTree added in v1.4.2

type CmdTree struct {
	Name string
	Help string
	Sub  []*CmdTree
	Fun  func([]string)
}

func (*CmdTree) Execute added in v1.4.2

func (c *CmdTree) Execute(args []string)

func (*CmdTree) Usage added in v1.4.2

func (c *CmdTree) Usage(args []string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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