Skip to content

Instantly share code, notes, and snippets.

@kasvith
Created July 26, 2019 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kasvith/5517d832de7ccad179d544c3db468458 to your computer and use it in GitHub Desktop.
Save kasvith/5517d832de7ccad179d544c3db468458 to your computer and use it in GitHub Desktop.
var packageTemplate = template.Must(template.New("").Funcs(map[string]interface{}{"conv": FormatByteSlice}).Parse(`// Code generated by go generate; DO NOT EDIT.
// generated using files from resources directory
// DO NOT COMMIT this file
package box
func init(){
{{- range $name, $file := . }}
resources.Add("{{ $name }}", []byte{ {{ conv $file }} })
{{- end }}
}
`))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment