util

package
v2.0.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CamelCaseToSnakeCase

func CamelCaseToSnakeCase(input string) string

CamelCaseToSnakeCase converts a `camelCase` string to `snake_case`

func Deref

func Deref[T any](p *T) T

Deref dereferences pointer values

func ExpandPath

func ExpandPath(path string) (out string, err error)

ExpandPath expands a path that possible contains a tilde (~) character into the home directory of the user

func GetJSONFilenames

func GetJSONFilenames(folder string) ([]string, error)

GetJSONFilenames returns all json files in the given folder

func IsNil

func IsNil(value any) bool

IsNil checks if an interface value is nil or if the value nil is assigned to it.

func Ref

func Ref[T any](p T) *T

Ref references pointer values

func SafeTimestamp

func SafeTimestamp(t *time.Time) int64

SafeTimestamp returns either the UNIX timestamp of the time t or 0 if it is nil

Types

This section is empty.

Jump to

Keyboard shortcuts

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