I can run pkger -o some/nested/path and everything works just fine, generating some/nested/path/pkged.go with package main. However, if I run pkger -include /some/nested/path -o some/nested/path, I get errors because it doesn't correctly resolve that the /v10 suffix on the module declared in the go.mod file is the current directory, so it tries to go to github to get it.
2021/02/04 15:06:08 exit status 1: go: finding module for package github.com/thisisme/somerepo/v10
can't load package: package github.com/thisisme/somerepo/v10: module github.com/thisisme/somerepo@latest found (v7.0.23+incompatible), but does not contain package github.com/thisisme/somerepo/v10
From version 8, we have been explicitly declaring the module with the path element containing the major version, so the most recent version it can find without a /vN suffix is v7.0.23, which is tagged, but still uses the bare name for the module declaration. Since this module has a lot of directories and many files, running pkger without -include in order to include a single text file takes a remarkably long time. It's not the end of the world, but it would be better if it worked correctly with path-based go module versioning.
If you are using go modules with versions specified via path and tag, pkger -include fails.
go.mod:
some/nested/path/main.go:
some/nested/path/file.txt:
I can run
pkger -o some/nested/path
and everything works just fine, generating some/nested/path/pkged.go with package main. However, if I runpkger -include /some/nested/path -o some/nested/path
, I get errors because it doesn't correctly resolve that the /v10 suffix on the module declared in the go.mod file is the current directory, so it tries to go to github to get it.From version 8, we have been explicitly declaring the module with the path element containing the major version, so the most recent version it can find without a /vN suffix is v7.0.23, which is tagged, but still uses the bare name for the module declaration. Since this module has a lot of directories and many files, running pkger without -include in order to include a single text file takes a remarkably long time. It's not the end of the world, but it would be better if it worked correctly with path-based go module versioning.