DEV Community

Discussion on: Table driven tests in Go

Collapse
 
madislohmus profile image
Madis Lõhmus

Tabel driven tests in go are awesome. I like that they also allow you to run each sub-test separately with go test -run "TestFoo".

A small typo in the article: got != tt.want shouldn't compile as you can compare a slice to nil only.

Collapse
 
plutov profile image
Alex Pliutau

Oh, you are right. DeepEqual can be used instead. I modified the code example.