You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying the following example project that uses Go modules vfsgen-test2.zip, I get the following error:
2020/07/23 00:40:54 cannot find module providing package github.com/segevfiner/vfsgen-test2/assets/assets: module github.com/segevfiner/vfsgen-test2/assets/assets: git ls-remote -q origin in /Users/segev/go/pkg/mod/cache/vcs/b1dce0b5aa30a69878ddaa81a87781bd321f95d17cec9ee5bf25190b026b94ea: exit status 128:
remote: Repository not found.
fatal: repository 'https://github.com/segevfiner/vfsgen-test2/' not found
exit status 1
Whether I try go run or go generate, caused by the importPathToDir trick that tries to avoid working directory problems. I resorted to just placing the go:generate comment at the main package and using Filename to get vfsgen to write its output under the assets package instead of at the main package.
@segevfiner In module mode, build.Import can only be used to find Go packages, meaning the directory needs to contain at least one .go file. In your snippet:
Overall, I suspect it's not worth using build.Import in module mode anymore. It may be better to find the directory corresponding to the root of the module, and go from there. See golang/dl@1b9ab27 for an example of that.
I don't see mentions of importPathToDir in this repository, so I don't think there's anything more to do here.
Trying the following example project that uses Go modules vfsgen-test2.zip, I get the following error:
Whether I try
go run
orgo generate
, caused by theimportPathToDir
trick that tries to avoid working directory problems. I resorted to just placing thego:generate
comment at the main package and usingFilename
to getvfsgen
to write its output under theassets
package instead of at the main package.From #83
The text was updated successfully, but these errors were encountered: