add "/" to basedir if not present
This commit is contained in:
parent
c2ad30bbc5
commit
c562e32f91
@ -3,6 +3,7 @@ package ginpongo2
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/flosch/pongo2"
|
||||
"github.com/gin-gonic/gin/render"
|
||||
@ -49,6 +50,9 @@ func New(basedir string, debug bool) *Pongo {
|
||||
p := new(Pongo)
|
||||
p.set = pongo2.NewSet("html")
|
||||
p.set.Debug = debug
|
||||
if !strings.HasSuffix(basedir, "/") {
|
||||
basedir = basedir + "/"
|
||||
}
|
||||
p.basedir = basedir
|
||||
return p
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user