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.

Use "." to refer to the current path's package in reflect mode #388

@XSAM

Description

@XSAM

Introduction

I use go:generate in my source code to invoke mockgen to generate mocked interfaces.

e.g.

//go:generate mockgen -destination=mocks/foo.pb.go github.com/xxx/xxx/pkg/xxx Foo

But it's too annoying that every time I have to write and check the package name (github.com/xxx/xxx/pkg/xxx).

And add the full package name in a source file is kind of duplicated information since golang could parse the file path and get the package name.

Feature request

So I want to add a feature that can use . to refer to the current path's package.

e.g.

//go:generate mockgen -destination=mocks/foo.pb.go . Foo

Just a single ., no more github.com/xxx/xxx/pkg/xxx.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions