Update 'go-cheatsheet.md'

This commit is contained in:
Jeffrey Paul 2020-10-05 09:57:11 +00:00
parent 238822dc81
commit 4658ed8b28

View File

@ -2,6 +2,26 @@
## testing ## 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 ``` go
t.Logf("%#v", eim) t.Logf("%#v", eim)
``` ```