I have a directory structure as follows:
.
├── client
│ └── index.html
├── cmd
│ └── projectd
│ ├── projectd
│ └── main.go
├── models.go
└── server.go
cmd/gideond.go
produces the actual binary.
I want to run go-bindata client/
so that I can embed the files in the client directory.
Questions:
- Where should I put the go generate comment, keeping in mind that I need access to the assets in
server.go
. If I put it inserver.go
I have to rungo generate
in the root directory and not incmd/projectd
- Should I structure my code in another way?
- How do I serve a HTML document and a javascript bundle using
go-bindata
? - Is it possible to source an embedded javascript file in a golang templates/html template?