sxcli.devSimple Extensible CLI

sxcli.dev/conf/fail

go
go
import "sxcli.dev/conf/fail"

Package fail is the violation collector of the sxcli ecosystem: record every problem, never panic, fail once listing all of them. Startup diagnostics that stop at the first error waste every following run; a Collector carries the whole verdict.

Index#

type Collectorsrc#

Collector accumulates startup violations in occurrence order. The zero value is ready to use. Callers gate phases by comparing Len snapshots taken before and after a phase.

go
go
type Collector struct {
    // contains filtered or unexported fields
}

func (*Collector) Addsrc#

go
go
func (c *Collector) Add(err error)

Add records one pre-built error.

func (*Collector) Allsrc#

go
go
func (c *Collector) All() []error

All returns every recorded violation in occurrence order.

func (*Collector) Failsrc#

go
go
func (c *Collector) Fail(format string, args ...any)

Fail records one formatted violation.

func (*Collector) Lensrc#

go
go
func (c *Collector) Len() int

Len returns the number of recorded violations.