Update 'go-cheatsheet.md'

This commit is contained in:
Jeffrey Paul 2020-10-05 09:57:11 +00:00
parent 238822dc81
commit 4658ed8b28
1 changed files with 20 additions and 0 deletions

View File

@ -2,6 +2,26 @@
## testing
### use testify
```
import "github.com/stretchr/testify/assert"
func TestSomething(t *testing.T) {
a := assert.New(t)
thing, err := functionCall()
t.Logf("%#v", thing)
a.NotNil(err)
}
```
### use %#v
``` go
t.Logf("%#v", eim)
```