Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

Fix pkger generating the wrong package name for pkger.go #80

Merged
merged 1 commit into from
Mar 11, 2020

Conversation

taiyangc
Copy link
Contributor

The issue is that, if pkger.go is created (empty) before the go list -json call it will fail and give the generic directory name instead of the
actual package name under the directory. This is fine in most cases,
except when the package name differs from the directory name - which is
allowed. Then pkger.go will conflict and fail to compile with the rest
of *.go under the same directory.

To fix, we simply obtain the real package name before creating the dummy
pkger.go file and then pass the name into the file.

The issue is that, if pkger.go is created (empty) before the `go list
-json` call it will fail and give the generic directory name instead of the
actual package name under the directory. This is fine in most cases,
except when the package name differs from the directory name - which is
allowed. Then pkger.go will conflict and fail to compile with the rest
of *.go under the same directory.

To fix, we simply obtain the real package name before creating the dummy
pkger.go file and then pass the name into the file.
@markbates markbates merged commit a78c11e into markbates:master Mar 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants