invariant

package
v0.0.0-...-bef5c4b Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 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 Check

func Check(cond bool, statement string)

func Checkf

func Checkf(cond bool, format string, args ...any)

func SetViolationExecutor

func SetViolationExecutor(exector ViolationExecutor)

func Violate

func Violate(statement string)

func Violatef

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

Types

type MockViolationExecutor

type MockViolationExecutor struct {
	mock.Mock
}

func NewMockViolationExecutor

func NewMockViolationExecutor(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockViolationExecutor

func (*MockViolationExecutor) Exec

func (_m *MockViolationExecutor) Exec(_a0 ViolationError)

type PanicViolationExecutor

type PanicViolationExecutor struct{}

func NewPanicViolationExecuter

func NewPanicViolationExecuter() *PanicViolationExecutor

func (*PanicViolationExecutor) Exec

func (executor *PanicViolationExecutor) Exec(err ViolationError)

type ViolationError

type ViolationError struct {
	Statement string
}

func (ViolationError) Error

func (err ViolationError) Error() string

type ViolationExecutor

type ViolationExecutor interface {
	Exec(ViolationError)
}

Jump to

Keyboard shortcuts

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