teslamotors / ansible_puller

Ansible daemon for massively-scaleable Ansible
MIT License
125 stars 33 forks source link

Use Go 1.16 Embed for the HTML files #21

Open arschles opened 3 years ago

arschles commented 3 years ago

Using embed would remove the requirement for packr in the development workflow. Using this method, you also get assets built into an embed.FS, which is an implementation of the new fs.FS, which in turn has interoperability with lots of the standard library and a growing number of other libraries.

The drawback of this approach would be that Go 1.16+ would be required. Having used both Packr and the built-in tooling, I believe that embed is a better choice in this situation. Note that if 1.11+ is a hard requirement, it would be possible to support versions [1.11, 1.16) with build tags, while still supporting embed for 1.16 and beyond.

Edit: I am happy to contribute a PR for this.