Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

can't generate mock with import tag versioning #379

Closed
iDevoid opened this issue Jan 7, 2020 · 2 comments
Closed

can't generate mock with import tag versioning #379

iDevoid opened this issue Jan 7, 2020 · 2 comments

Comments

@iDevoid
Copy link

iDevoid commented Jan 7, 2020

Actual behavior

mockgen -destination=mocks/mock_user.go -source=internal/module/user/initiator.go
2020/01/07 17:24:53 Loading input failed: internal/module/user/initiator.go:54:6: failed parsing arguments: internal/module/user/initiator.go:54:12: unknown package "atreugo"

Expected behavior it should generate the mock

To Reproduce Steps to reproduce the behavior

I am using "github.com/savsgio/atreugo/v10" for my http router
with interface

type Handler interface {
	Test(ctx *atreugo.RequestCtx) error
	CreateNewAccount(ctx *atreugo.RequestCtx) error
}

it seems that gomock doesn't recognize the tag versioning, so it results as panic because there is no atreugo inside of my imports.

Additional Information

  • gomock version: v1.3.1
  • golang version: go version go1.13.1 linux/amd64
@codyoss
Copy link
Member

codyoss commented Jan 12, 2020

Sounds like this could be a dupe of #326

@codyoss
Copy link
Member

codyoss commented Jan 12, 2020

Going to close this one so we can keep discussion in one spot. There is a workaround for this. In your code you can alias your import: import atreugo "github.com/savsgio/atreugo/v10"

@codyoss codyoss closed this as completed Jan 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants