From 4658ed8b284ec288fb402fc5b11e4771d103a404 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Mon, 5 Oct 2020 09:57:11 +0000 Subject: [PATCH] Update 'go-cheatsheet.md' --- go-cheatsheet.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/go-cheatsheet.md b/go-cheatsheet.md index 2deb17e..9173ab8 100644 --- a/go-cheatsheet.md +++ b/go-cheatsheet.md @@ -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) ```