-
Notifications
You must be signed in to change notification settings - Fork 9
/
main-packr.go
17 lines (15 loc) · 52 KB
/
main-packr.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package main
import "github.com/gobuffalo/packr"
// !!! GENERATED FILE !!!
// Do NOT hand edit this file!!
// It is recommended that you DO NOT check into this file into SCM.
// We STRONGLY recommend you delete this file after you have built your
// Go binary. You can use the "packr clean" command to clean up this,
// and any other packr generated files.
func init() {
packr.PackJSONBytes("./tmpl", "model.html", "\"e3tkZWZpbmUgIm1vZGVsIn19CnBhY2thZ2Uge3sgLlBhY2thZ2VOYW1lIH19CgovKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKfCBDb2RlIGdlbmVyYXRlZCBieSBtb2RlbGdlbiB8CnwgICAgICAgIERPIE5PVCBFRElULiAgICAgICAgfAorLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KCi8vIElmIHlvdSB3YW50IHRvIGV4dGVuZCBiZWhhdmlvdXI6Ci8vIFBsZWFzZSBjcmVhdGUgYSBjdXN0b20gZmlsZSBpbiB0aGlzIGRpcmVjdG9yeQovLyBhbmQgY3JlYXRlIHRoZSBtZXRob2RzIHRoZXJlIHRvIGF2b2lkIG92ZXJ3cml0aW5nIHlvdXIgY29kZSB3aXRoIHRoZSBnZW5lcmF0ZWQgb25lLgoKaW1wb3J0ICgKICAgICJmbXQiCiAgICB7ey0gcmFuZ2UgJGssICR2Oj0gLk1vZGVsLkltcG9ydHMgfX0KICAgICJ7eyRrfX0iCiAgICB7ey0gZW5kIH19CikKCmNvbnN0ICgKICAgIHNlbGVjdHt7Lk1vZGVsLk5hbWV9fSA9ICJ7eyAuTW9kZWwuRmllbGRzIHwgc2VsZWN0X2ZpZWxkc319IgopCgovLyB7ey5Nb2RlbC5OYW1lfX0gcmVwcmVzZW50cyBhIHJvdyBpbiB0aGUge3suTW9kZWwuVGFibGVOYW1lfX0gdGFibGUKdHlwZSB7ey5Nb2RlbC5OYW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