Error when build assets (templates,etc) into the binary
Hi I'm following the instructions here https://doc.getqor.com/guides/bindatafs.html with a project with the layout below

I initialized bindata as a following
bindatafs config/bindatafs
Initializing BindataFS... copy from /home/user/go/src/github.com/qor/bindatafs/templates to config/bindatafs
After I changed the source code as requested.


And when I tried to compile the templates into the binary I got the error below
~/go/src/github.com/user/CtrlCollectors$ go run -tags 'bindatafs' main.go
github.com/user/CtrlCollectors/config/bindatafs
config/bindatafs/bindatafs.go:80: undefined: _bindata config/bindatafs/bindatafs.go:81: undefined: Asset config/bindatafs/bindatafs.go:87: undefined: _bindata config/bindatafs/bindatafs.go:88: undefined: _bindata config/bindatafs/bindatafs.go:224: undefined: _bindata config/bindatafs/bindatafs.go:225: undefined: Asset config/bindatafs/bindatafs.go:231: undefined: _bindata config/bindatafs/bindatafs.go:233: undefined: _bindata
after running without tags I received the message below go run main.go Compiling templates...
I got my final project structure/files

Then build the project
go build -tags enterprise main.go
OR
go build main.go
But when running I get the message below ./main Compiling templates...
Before my error message was similar to the following issues
#56 #87 #33 #88
Also, the approach informed by @fengde didn't work either @jaytaylor
Guys, QOR is really nice framework but the documentation about deployment could be improved, this kind of error is a pain in the ass and could be easier to define a project structure and make EXPLICIT commands and instructions for build binary with the assets.
Or I really missing an obvious step
Thanks a lot.
The two steps to make bindatafs work should be:
- trigger the
Compile()function. In qor-example this is done with the--compile-templatesflag.
This should create new go code under config/admin/bindatafs with the embedded files.
- build your server with the bindata tag.
The binary created still doesn't work standalone. Atleast when I run on nginx. EDIT: It will work if $uri exactly matches the $uri the admin is mounted on. You can't proxy pass with an ending slash.