Update 'go-cheatsheet.md'
This commit is contained in:
parent
238822dc81
commit
4658ed8b28
@ -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)
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user