util

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const Strings strings = ""

Variables

This section is empty.

Functions

func EnsureDirectory added in v0.1.2

func EnsureDirectory(path string, mode fs.FileMode) error

EnsureDirectory checks that file exists. If not, creates an empty directory.

func EnsureFile added in v0.1.2

func EnsureFile(path string, mode fs.FileMode) error

EnsureFile checks that file exists. If not, creates an empty file.

func FilterSlice

func FilterSlice[T any](items []T, filter func(T) bool) []T

func KeyFunc

func KeyFunc[V any, K comparable](items []V, fn func(V) K) map[K]V

func Keys

func Keys[T comparable, V any](items map[T]V) []T

func MapSlice

func MapSlice[T, E any](items []T, mapper func(T) E) []E

func Pow64

func Pow64(a, b int64) int64

func Ptr

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

func SHA256

func SHA256(s []byte) []byte

func Set

func Set[T comparable](items []T) map[T]struct{}

func ToStringMap

func ToStringMap[T ~string](items []T) []string

func TronHexToBase58

func TronHexToBase58(address string) string

input: 41b35b60a4572e473e492ee35f0750f95c682e081c output: TSKZRR9egK9YSXGdbVQGrVoBVc18AYpEBz

Types

This section is empty.

Jump to

Keyboard shortcuts

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