-
Notifications
You must be signed in to change notification settings - Fork 9
/
a_main-packr.go
15 lines (12 loc) · 51.3 KB
/
a_main-packr.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Code generated by github.com/gobuffalo/packr. DO NOT EDIT.
package main
import "github.com/gobuffalo/packr"
// You can use the "packr clean" command to clean up this,
// and any other packr generated files.
func init() {
packr.PackJSONBytes("./tmpl", "model.html", "\"e3tkZWZpbmUgIm1vZGVsIn19CnBhY2thZ2Uge3sgLlBhY2thZ2VOYW1lIH19CgovKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKfCBDb2RlIGdlbmVyYXRlZCBieSBtb2RlbGdlbiB8CnwgICAgICAgIERPIE5PVCBFRElULiAgICAgICAgfAorLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KCi8vIElmIHlvdSB3YW50IHRvIGV4dGVuZCBiZWhhdmlvdXI6Ci8vIFBsZWFzZSBjcmVhdGUgYSBjdXN0b20gZmlsZSBpbiB0aGlzIGRpcmVjdG9yeQovLyBhbmQgY3JlYXRlIHRoZSBtZXRob2RzIHRoZXJlIHRvIGF2b2lkIG92ZXJ3cml0aW5nIHlvdXIgY29kZSB3aXRoIHRoZSBnZW5lcmF0ZWQgb25lLgoKaW1wb3J0ICgKImZtdCIKICAgIHt7IHJhbmdlICRrLCAkdjo9IC5Nb2RlbC5JbXBvcnRzIH19CiAgICAie3ska319IgogICAge3stIGVuZCB9fQopCgovLyB7ey5Nb2RlbC5OYW1lfX0gcmVwcmVzZW50cyBhIHJvdyBpbiB0aGUge3suTW9kZWwuVGFibGVOYW1lfX0gdGFibGUKdHlwZSB7ey5Nb2RlbC5OYW1lfX0gc3RydWN0IHsKICAgIHt7IHJhbmdlICRrLCAkdjo9IC5Nb2RlbC5GaWVsZHMgfX0KICAgICAgICB7eyAkdi5OYW1lIH19IHt7ICR2LlR5cGUgfX0gYGpzb246Int7JHYuQ29sdW1uTmFtZX19ImAKICAgIHt7LSBlbmQg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