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

-self_package does not work when -package is different from the base dir of package path #342

@linzhp

Description

@linzhp

Steps to reproduce:

  1. Clone git@github.com:linzhp/go_examples.git to GOPATH
  2. Run mockgen -package core -self_package github.com/linzhp/go_examples/interfaces github.com/linzhp/go_examples/interfaces Methods

What do I expect:

The generated mock should not import github.com/linzhp/go_examples/interfaces because it is specified in -self_package

What do I see instead:

import (
	gomock "github.com/golang/mock/gomock"
	interfaces "github.com/linzhp/go_examples/interfaces"
	reflect "reflect"
)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions