Building Lang.ai

Stories from our team

Follow publication

7 Testing Techniques for Your Golang Codebase

Enrique Fueyo
Building Lang.ai
Published in
4 min readNov 6, 2019

Source: https://github.com/egonelbre/gophers

1. Choosing where to place the tests

2. Using helper functions that don’t return an error

3. Taking advantage of Ginkgo

4. Using configuration functions

5. Using golden files

6. Using fixtures

- id: 1
title: "Pedro Páramo"
author: "Juan Rulfo"
- id: 2
title: "Meditations"
author: "Marcus Aurelius"
- id: 3
title: "Walden"
author: "Henry David Thoreau"

7. Mocking external services (httptest.Server)

Further resources

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response