Browse Source

go.rice needs string literal

pull/12/head v0.1
andreimarcu 9 years ago
parent
commit
ae1933c93b
  1. 2
      server.go
  2. 4
      templates.go

2
server.go

@ -51,7 +51,7 @@ func setup() {
} }
// Template setup // Template setup
p2l, err := NewPongo2Loader("templates")
p2l, err := NewPongo2TemplatesLoader()
if err != nil { if err != nil {
fmt.Println("Error: could not load templates") fmt.Println("Error: could not load templates")
os.Exit(1) os.Exit(1)

4
templates.go

@ -14,10 +14,10 @@ type Pongo2Loader struct {
box *rice.Box box *rice.Box
} }
func NewPongo2Loader(boxName string) (*Pongo2Loader, error) {
func NewPongo2TemplatesLoader() (*Pongo2Loader, error) {
fs := &Pongo2Loader{} fs := &Pongo2Loader{}
p2l, err := rice.FindBox(boxName)
p2l, err := rice.FindBox("templates")
if err != nil { if err != nil {
return nil, err return nil, err
} }

Loading…
Cancel
Save