This repo demonstrates a few ways to mock outbound HTTP requests in Go.
git clone https://github.com/sonya/go-http-mocking
cd go-http-mocking
cd approaches
go mod download`
From the root of this repo, run:
cd approaches
go test ./...
From the root of this repo, run:
docker-compose up -d
cd approaches
go test --tags=integration ./... # one of these should fail
docker-compose down