Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

assert.go

I'm sure there are better assertion libraries better fit for your needs... This one is simple, at just 5 lines of code, no dependencies...

Putting this here because I know I'll want it in other places...

Installation

go get github.com/b0dee/assert.go

Usage

To use, I recommend dot-importing as you likely do not have name conflicts for the 2 functions defined in this library...

import . "github.com/b0dee/assert.go"

Runtime assert

Use this as a mosqueto net for your code base, Go's error handling ideology is great, though sometimes we want to abort

func foo(a int) { 
    Assert(a == 69 || a == 420, "Pick a better number")
    // code...
}

About

Static and runtime asserts for Go

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages