utils

package
v0.0.0-...-1c9d968 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmptyOrDefault

func EmptyOrDefault[T any](s []T, defaultValue T) (t T)

func If

func If[T any](cond bool, onTrue T, onFalse T) T

func MustReadStringFromFile

func MustReadStringFromFile(path string) string

func MustWriteStringToFile

func MustWriteStringToFile(path string, content string)

func PathExists

func PathExists(path string) (bool, error)

func ReadStringFromFile

func ReadStringFromFile(path string) (string, error)

func SafeIndexValueOrDefault

func SafeIndexValueOrDefault[T any](s []T, idx int) (t T)

func WriteStringToFile

func WriteStringToFile(path string, content string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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