RSSAmplifier

Go Tutorial - Learn Go from the Basics with Code Examples on golangbot.com · Apr 10, 2025

Unit testing using mocks in Go

0
Sign in to vote or save

This page cannot be shown here. You can still read it on the original site — the toolbar below keeps your place in the directory.

Why mocks are needed? I generally prefer testing my code without using mocks. For example, if the code is integrated with Elastic Search, I prefer to run a elastic search container locally and test the Go code against that container. But there are some cases where creating a local environment for testing is not possible. This usually happens when integrating with cloud providers. Let’s take…

Read on golangbot.com

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.