Skip to content
/ assert Public

An assert function for Go that works like the one in C.

License

Notifications You must be signed in to change notification settings

tidwall/assert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Assert

GoDoc

This package provides an assert function for Go. It's designed to work like assert in C.

Example

package my_test

import "github.com/tidwall/assert"

func TestMyThing(t *testing.T) {
    assert.Assert("hello" == "jello")
}

This will print the following message and abort the program.

Assertion failed: ("hello" == "jello"), function TestMyThing, file my_test.go, line 6.

About

An assert function for Go that works like the one in C.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages