markbates / pkger

Embed static files in Go binaries (replacement for gobuffalo/packr)
MIT License
1.19k stars 60 forks source link

here.Package error #119

Open mlboy opened 4 years ago

mlboy commented 4 years ago

error: here.Package: example.com/test: here.cache: example.com/test: [go list -json -find example.com/test] exit status 1: go: finding module for package example.com/test cannot find module providing package example.com/test: unrecognized import path "example.com": parse https://example.com/?go-get=1: no go-import meta tags ()

mlboy commented 4 years ago

error: here.Package: command-line-arguments: here.cache: command-line-arguments: [go list -json -find command-line-arguments] exit status 1: go: cannot find main module; see 'go help modules'

jaskirat8 commented 3 years ago

we are also facing the same issue for statically compiled binary, using this package as an import. image

behaviour is as following for the environment running the statically compiled binary :

  1. go <1.16 or no go at all - It will work.
  2. go >=1.16 - It fails with an error. here.Package: command-line-arguments: here.cache: command-line-arguments: [go list -json -find command-line-arguments] exit status 1: go: go.mod file not found in current directory or any parent directory; see 'go help modules'

Any pointers ?