The post discusses the approach for testing Go code using the standard library, focusing on idiomatic practices and the use of functions like `t.Errorf` and `t.Fatalf` instead of assertion libraries like Testify. It highlights the benefits of writing clear, maintainable tests and contrasts this with the pitfalls of using assertion libraries that call `t.FailNow`. The post also touches on using go-cmp for deep comparisons and the drawbacks of BDD frameworks like Ginkgo in Go's ecosystem.
Table of contents
Optimizing for reading vs. optimizing for writingOn t.FailNow() and testify/requireHelper functions vs. assertion functionComparing full structuresCan we do worse?Closing thoughts1 Comment
Sort: