must

package
v0.0.0-...-428fcb3 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: MPL-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do[T any](t T, err error) T

Do panics if err is not nil, otherwise returns t. It is useful in wrapping a two-value function call where you know statically that the call will succeed.

Example:

url := must.Do(url.Parse("http://example.com"))

Types

This section is empty.

Jump to

Keyboard shortcuts

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