invariant

package
v0.0.0-...-4fa2157 Latest Latest
Warning

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

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

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