You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.
prog.go:14:2: package internal/service/designpattern is not in GOROOT (/usr/local/Cellar/go/1.14.6/libexec/src/internal/service/designpattern)
prog.go:12:2: cannot find module providing package github.com/golang/mock/mockgen/model: working directory is not part of a module
prog.go:14:2: package internal/service/designpattern is not in GOROOT (/usr/local/Cellar/go/1.14.6/libexec/src/internal/service/designpattern)
2020/09/21 12:09:11 Loading input failed: exit status 1
The text was updated successfully, but these errors were encountered:
bcmills
changed the title
package is not in GOROOT when trying for mockgen
mockgen: "package is not in GOROOT" when generating a mock outside of a module
Sep 22, 2020
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Nothing as such
What operating system and processor architecture are you using (
go env
)?GOOS="darwin"
go env
OutputWhat did you do?
Trying to generate mock for the provided interface 'CorHandler' in package 'designpattern'
for the given code:
`package designpattern
import "context"
// chain of responsibility handler
//go:generate mockgen -destination=mocks/mock_corhandler.go -package=mocks . CorHandler
type CorHandler interface {
}`
command tried:
mockgen -destination=mocks/mock_corhandler.go -package=mocks internal/service/designpattern CorHandler
also: $pwd
/Users/zo/go/src/github.com/Z/dlos
What did you expect to see?
Something like mocks generated.
What did you see instead?
prog.go:14:2: package internal/service/designpattern is not in GOROOT (/usr/local/Cellar/go/1.14.6/libexec/src/internal/service/designpattern)
prog.go:12:2: cannot find module providing package github.com/golang/mock/mockgen/model: working directory is not part of a module
prog.go:14:2: package internal/service/designpattern is not in GOROOT (/usr/local/Cellar/go/1.14.6/libexec/src/internal/service/designpattern)
2020/09/21 12:09:11 Loading input failed: exit status 1
The text was updated successfully, but these errors were encountered: