utils

package
v0.0.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrLog

func ErrLog(err error) slog.Attr

func FinalizeLogger

func FinalizeLogger(handler slog.Handler)

func HandleError added in v0.0.4

func HandleError(msg string, err error)

func LoadEnv

func LoadEnv(envs ...EnvLoader) error

func Logger

func Logger() *slog.Logger

func LookupEnv added in v0.0.4

func LookupEnv(t *testing.T, key string) string

func Must1

func Must1[T any](val T, err error) T

func SafeClose

func SafeClose(c Closer)

func SafeWrite

func SafeWrite(w io.Writer, b []byte)

Types

type Closer

type Closer interface {
	Close() error
}

type EnvLoader

type EnvLoader func() error

func Env

func Env(key string, dst *string) EnvLoader

Jump to

Keyboard shortcuts

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