Skip to content

Commit

Permalink
packages: add module information
Browse files Browse the repository at this point in the history
Allows to use `.Package.Module` for formatting labels.

Fixes #57
  • Loading branch information
egonelbre committed Mar 4, 2022
1 parent 6ea35b5 commit 86e8ec0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/pkgset/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (ctx *Context) Set(key, value string) {
func (ctx Context) Config() *packages.Config {
config := &packages.Config{
Context: ctx.Context,
Mode: packages.NeedName | packages.NeedFiles | packages.NeedCompiledGoFiles | packages.NeedImports,
Mode: packages.NeedName | packages.NeedFiles | packages.NeedCompiledGoFiles | packages.NeedImports | packages.NeedModule,
Env: ctx.Env,
Tests: ctx.Tags.ValueOf("test") == "1",
}
Expand Down
2 changes: 1 addition & 1 deletion internal/pkgset/std.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var stdonce sync.Once
func loadstd() {
stdonce.Do(func() {
standard, err := packages.Load(&packages.Config{
Mode: packages.NeedName | packages.NeedFiles | packages.NeedCompiledGoFiles | packages.NeedImports,
Mode: packages.NeedName | packages.NeedFiles | packages.NeedCompiledGoFiles | packages.NeedImports | packages.NeedModule,
Tests: true,
}, "std")

Expand Down

0 comments on commit 86e8ec0

Please sign in to comment.