testing-with-gomock icon indicating copy to clipboard operation
testing-with-gomock copied to clipboard

Tutorial requires sgreben doer package

Open bath opened this issue 4 years ago • 0 comments

Greetings,

Following tutorial on: https://blog.codecentric.de/en/2017/08/gomock-tutorial/#basic-usage

When using:
mockgen -destination=mocks/mock_doer.go -package=mocks github.com/sgreben/testing-with-gomock/doer Doer

I receive: prog.go:14:2: cannot find package "github.com/sgreben/testing-with-gomock/doer" in any of: /usr/local/go/src/github.com/sgreben/testing-with-gomock/doer (from $GOROOT) /Users/millerbath/go/src/github.com/sgreben/testing-with-gomock/doer (from $GOPATH) prog.go:14:2: cannot find package "github.com/sgreben/testing-with-gomock/doer" in any of: /usr/local/go/src/github.com/sgreben/testing-with-gomock/doer (from $GOROOT) /Users/millerbath/go/src/github.com/sgreben/testing-with-gomock/doer (from $GOPATH) 2020/06/14 16:37:51 Loading input failed: exit status 1

This is because I needed to run:
go get github.com/sgreben/testing-with-gomock/doer

As I was following along with the tutorial by cloning this repository, I ran into the issue above. I am new to Go, so this was confusing for me. Thought I'd let you(or others) know in case this has been a problem.

bath avatar Jun 14 '20 21:06 bath