Help us shape the future of Go! Take the 2026 Go Developer Survey

must

package
v0.20261020.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 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