assert

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package assert provides runtime invariant checks for coord internals.

Assertions trigger panics on failure — they signal programmer errors, not operating errors. Operating errors use coord's sentinel errors. See docs/invariants.md for the canonical invariant list.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NoError

func NoError(err error, msg string, args ...any)

NoError panics if err is non-nil. Use where an error would indicate internal corruption, not an operating failure the caller can handle.

func NotEmpty

func NotEmpty(s string, msg string, args ...any)

NotEmpty panics if s is the empty string.

func NotNil

func NotNil(v any, msg string, args ...any)

NotNil panics if v is nil (including typed-nil via reflect).

func Postcondition

func Postcondition(cond bool, msg string, args ...any)

Postcondition panics if cond is false. Semantically identical to Precondition but marks the check as a return-time invariant.

func Precondition

func Precondition(cond bool, msg string, args ...any)

Precondition panics if cond is false, formatting msg with args. Use for caller-contract checks at the start of a function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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