All languages

Go for DevOps

You're viewing a free preview. Sign in free to read every script.

Why this exists Go has testing built in: no framework to install, just go test. Good Go tests rely on two ideas. Small interfaces let you swap a real dependency (a chat webhook, a database) for a fake, and table driven…

Interfaces and Testing: Table-Driven Tests, Fakes and httptest

Small interfaces to make code testable, a fake notifier for tests, table-driven tests with subtests, testing HTTP code with httptest, and running tests with the race detector and coverage.

Sign in free to read this script, along with the rest of the library.

Sign in free