must

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package must provides runtime assertions. Violation of these assertions indicates a program fault, and should cause a crash to prevent operating with invalid data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeEmptyMapf

func BeEmptyMapf[Map ~map[K]V, K comparable, V any](m Map, format string, args ...any)

BeEmptyMapf panics if m is not an empty map.

func BeEqualf

func BeEqualf[T comparable](a, b T, format string, args ...any)

BeEqualf panics if a != b.

func Bef

func Bef(b bool, format string, args ...any)

Bef panics if b is false.

func Failf

func Failf(format string, args ...any)

Failf unconditionally panics with the given message.

func NotBeBlankf

func NotBeBlankf[Str ~string](s Str, format string, args ...any)

NotBeBlankf panics if s is empty or contains only whitespace.

func NotBeEmptyf

func NotBeEmptyf[S ~[]T, T any](es S, format string, args ...any)

NotBeEmptyf panics if es is an empty slice.

func NotBeEqualf

func NotBeEqualf[T comparable](a, b T, format string, args ...any)

NotBeEqualf panics if a == b.

func NotBeNilf

func NotBeNilf(v any, format string, args ...any)

NotBeNilf panics if v is nil.

func NotBef

func NotBef(b bool, format string, args ...any)

NotBef panics if b is true.

func NotContainf

func NotContainf[S ~[]T, T comparable](es S, e T, format string, args ...any)

NotContainf panics if e is in es.

Types

This section is empty.

Jump to

Keyboard shortcuts

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