util

package module
v0.0.0-...-ffbf222 Latest Latest
Warning

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

Go to latest
Published: May 18, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatFileSize

func FormatFileSize(bytes int64) string

func FromPtr

func FromPtr[T any](abc *T) T

func IfThen

func IfThen[T any](cond bool, val1 T, val2 T) T

func IgnoreError

func IgnoreError[T any](a T, _ error) T

func InSlice

func InSlice[T comparable](item T, items []T) bool

func IntSlice

func IntSlice[T int32 | uint32 | int64](abc []T) []int

func IntTSlice

func IntTSlice[T int32 | uint32 | int64 | uint64](abc []int) []T

func MapKeys

func MapKeys[K comparable, V any](m map[K]V) []K

func PrototextMarshal

func PrototextMarshal(m proto.Message) ([]byte, error)

func PrototextUnmarshal

func PrototextUnmarshal(b []byte, m proto.Message) error

func ToPtr

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

func ToPtrOrNil

func ToPtrOrNil[T any](ok bool, abc T) *T

Types

This section is empty.

Jump to

Keyboard shortcuts

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