uerror

package
v1.17.2 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: MIT Imports: 0 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Must

func Must(args ...any)

Must takes a variadic number of interface{} arguments and panics if the last argument is a non-nil error. This allows Must function to handle functions returning multiple values, where the last value is an error.

Examples:

  • With a function returning only an error: Must(doSomethingRisky())

  • With a function returning a result and an error: data, err := os.ReadFile("./myfile.txt") Must(data, err) // Panics if err is non-nil

  • Direct usage with a function that returns an error: Must(os.Remove("./myfile.txt")) // Panics if Remove returns an error

Types

This section is empty.

Jump to

Keyboard shortcuts

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