utilx

package
v0.0.147 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Must

func Must[T any](item T, err error) T

This if for functions that returns the patter `func(...) (out T, err error)` and is called in a function that expect this to not return any error and is also not returning error. It fallback to panic if an error is found.

obj, err := MyFunc()
require.NoError(t, err)
s := MyStruct{
	objField: obj
}

becomes

s := MyStruct{
	objField: utilx.Must(MyFunc())
}

Types

This section is empty.

Jump to

Keyboard shortcuts

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