File: a/a.go
// +build !mock
package a
func DoSomething() {
return "done"
}
File: a/a_mock.go
// +build mock
package a
func DoSomething() { // Insert fake implementation here
return "complete"
}
Execute tests using build tag:
$ go test -tags mock