go-check

A Golang library to create monitoring plugins

Release v1.0.0-rc4 latest

What's Changed

Breaking changes

Refactored status to be a type. The Status type now implements the Stringer interface

Exit codes are now represented by a Status type instead of an integer. The previous constants have been replaced by this type. A constructor from an integer and string was added.

NewStatus(status int) (Status, error)
NewStatusFromString(status string) (Status, error)

The StatusText function was replaced by implementing the Stringer interface in the Status type

Removed ExitRaw, replaced by Exit

Exit is now the primary function to handle program exit and status code handling.

Removed Exitf, replaced by Exit and fmt.Sprintf

Exitf was removed and should be replaced by using Exit with fmt.Sprintf

// Was
check.Exitf(check.OK, "Everything is fine - answer=%d", 42)

// Now
check.Exit(check.OK, fmt.Sprintf("Everything is fine - value=%d", 42))

Rework ParseBytes to return uint64 instead of interface

ParseBytes now returns an uint64 instead of an interface. The BytesIEC and BytesSI types have been replaces by functions with the same name to get a string representation of a number of unit64 bytes.

b, err := ParseBytes("2MiB")
// uint64 2 * 1024 * 1024

fmt.Println(convert.BytesIEC(b))
// "2MiB"

The perfdata package was merged into the check package

// Was
perfdata := perfdata.PerfdataList{}

// Now
perfdata := check.PerfdataList{}

WorstState was moved from the result to the check package

The WorstState is now in the check package. Otherwise the function has not changed.

// Was
rc = result.WorstState(states...)

// Now
rc = check.WorstState(states...)

Refactored and concurrency-safe Overall

The Overall type has been overhauled.

The Add and AddSubcheck now both append a PartialResults to simplify the behavior the the internals. The Summary attribute was replaced by the OKSummary.

Overall is now concurrency-safe.

Full Changelog: https://github.com/NETWAYS/go-check/compare/v1.0.0-rc3...v1.0.0-rc4

go-check-v1.0.0-rc4.tar.gz

Release tarball
application/gzip 2026-06-23 Download from Github

Release v1.0.0-rc3

What's Changed

Breaking changes

Refactored status to be a type. The Status type now implements the Stringer interface

Exit codes are now represented by a Status type instead of an integer. The previous constants have been replaced by this type. A constructor from an integer and string was added.

NewStatus(status int) (Status, error)
NewStatusFromString(status string) (Status, error)

The StatusText function was replaced by implementing the Stringer interface in the Status type

Removed ExitRaw, replaced by Exit

Exit is now the primary function to handle program exit and status code handling.

Removed Exitf, replaced by Exit and fmt.Sprintf

Exitf was removed and should be replaced by using Exit with fmt.Sprintf

// Was
check.Exitf(check.OK, "Everything is fine - answer=%d", 42)

// Now
check.Exit(check.OK, fmt.Sprintf("Everything is fine - value=%d", 42))

Rework ParseBytes to return uint64 instead of interface

ParseBytes now returns an uint64 instead of an interface. The BytesIEC and BytesSI types have been replaces by functions with the same name to get a string representation of a number of unit64 bytes.

b, err := ParseBytes("2MiB")
// uint64 2 * 1024 * 1024

fmt.Println(convert.BytesIEC(b))
// "2MiB"

WorstState was moved from the result to the check package

The WorstState is now in the check package. Otherwise the function has not changed.

// Was
rc = result.WorstState(states...)

// Now
rc = check.WorstState(states...)

Refactored and concurrency-safe Overall

The Overall type has been overhauled.

The Add and AddSubcheck now both append a PartialResults to simplify the behavior the the internals. The Summary attribute was replaced by the OKSummary.

Overall is now concurrency-safe.

Full Changelog: https://github.com/NETWAYS/go-check/compare/v1.0.0-rc2...v1.0.0-rc3

go-check-v1.0.0-rc3.tar.gz

Release tarball
application/gzip 2026-06-18 Download from Github

Release v1.0.0-rc2

What's Changed

Breaking changes

ParseBytes now returns an uint64 instead of an interface. The BytesIEC and BytesSI types have been replaces by functions with the same name to get a string representation of a number of unit64 bytes.

b, err := ParseBytes("2MiB")
// uint64 2 * 1024 * 1024

fmt.Println(convert.BytesIEC(b))
// "2MiB"

Full Changelog: https://github.com/NETWAYS/go-check/compare/v1.0.0-rc1...v1.0.0-rc2

go-check-v1.0.0-rc2.tar.gz

Release tarball
application/gzip 2026-06-11 Download from Github
Newer Older