...

Package must

import "github.com/letsencrypt/boulder/must"
Overview
Index

Overview ▾

Index ▾

Package files

must.go

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"))