Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-debug generates wrong output (bindataFileInfo struct is missing) #58

Open
prantlf opened this issue May 5, 2020 · 7 comments
Open

Comments

@prantlf
Copy link

prantlf commented May 5, 2020

Currently is impossible to read the source files from the file system during the development.

Put static assets for a web site to the following directory structure in the project root:

assets/
  js/
  css/

Generate assets.go for the context of the assets directory:

$ go-bindata -debug -fs -o assets.go -prefix assets assets/...

Running the project fails (and so does a build):

$ go build main.go assets.go
# command-line-arguments
assets.go:120:10: undefined: bindataFileInfo

Running or building the project with assets.go generated with the -dev switch fails with the same error (you have to define rootDir). Running or building the project with assets.go generated without the -debug switch works well.

The workaround is to copy the declaration of bindataFileInfo and its methods from the generated output without the debug switch to the development project.

@prantlf
Copy link
Author

prantlf commented May 5, 2020

After looking around this repository I found that you merged a fix for this issue already. However, you have not released the fixed version yet.

If you install the latest version, the (currently latest) v3.1.3 will not be downloaded:

$ go get -u github.com/go-bindata/go-bindata/...
go: found github.com/go-bindata/go-bindata/... in github.com/go-bindata/go-bindata v3.1.2+incompatible

And an older one without the fix for this issue is added to go.mod:

github.com/go-bindata/go-bindata v3.1.2+incompatible // indirect

If you install the latest v3, it will download it properly, but it will add two extra packages, which you do not request:

$ go get -u github.com/go-bindata/go-bindata/v3/...
go: found github.com/go-bindata/go-bindata/v3/... in github.com/go-bindata/go-bindata/v3 v3.1.3
go: golang.org/x/lint upgrade => v0.0.0-20200302205851-738671d3881b
go: golang.org/x/tools upgrade => v0.0.0-20200505023115-26f46d2f7ef8
go: golang.org/x/xerrors upgrade => v0.0.0-20191204190536-9bdfabe68543

The unexpected packages added will be added to go.mod too:

github.com/go-bindata/go-bindata/v3 v3.1.3 // indirect
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8 // indirect

Could you release the latest v3, please, without the two unneeded packages? Thank you!

@kevinburke
Copy link

(note just for myself, since I have to look this up every time; this isn't broken on my fork because I never added a -fs mode; the debug tests work correctly)

@prantlf
Copy link
Author

prantlf commented May 6, 2020

I see. The file system interface is a very useful feature. I feed it to the HTTP server wrapped in a middleware to support response compression. It chains nicely.

@amireldor
Copy link

How strange. This happened to me today on my work laptop. It didn't happen on my personal laptop though, on the same project.

@tooolbox
Copy link

Still an issue?

@amireldor
Copy link

@tooolbox I'll try to check this again, hopefully tomorrow. Thanks

@tooolbox
Copy link

(As a note, I actually just ran into this and the solution was to go get github.com/go-bindata/go-bindata/v3/go-bindata@v3.1.3 and the issue went away. Probably needs an update to the README install instructions.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants