Closed ghost closed 3 years ago
Note: see yuri-norwood#2 for development notes.
I just wanted to feel out if this would be wanted / if there are any design considerations to make.
I'm sorry I didn't read this part of the issue description earlier (and so missed to respond). Thank you for making the pull request.
Concept
As of Go 1.16, the
embed
package allows embedding arbitrary files into variables in code. I think that using this built in rather than depending on an external tool likego-bindata
is nicer and the code itself is much cleaner and easier to read.Rationale
The way that
embed
works is by adding a directive comment with the target file's path above a variable declaration, such as a string or byte slice, and the compiler sets that variable to the contents of that file at build time. This is basically what we do now when we regenerate templates.go withgo-bindata
, however,embed
has two main advantages overgo-bindata
:embed
is a part of the build. This makes it easier for new contributors as usinggo-bindata
wasn't really obvious to me when I was making my first contribution here.Design
I've been meaning to add this since I read about
embed
in the release notes so I'll probably make a prototype on my fork at some point. I just wanted to feel out if this would be wanted / if there are any design considerations to make.