Unit testing using mocks in Go (golangbot.com)
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 the case where the code is creating a AWS s3 bucket.