mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-14 20:22:20 +08:00
Merge 1c975b54dd1899fefec945f26ac250286c65edf1 into c224bf82111883dbe354edf9376642f615b7248e
This commit is contained in:
commit
c39b889d37
6
gin.go
6
gin.go
@ -123,7 +123,9 @@ func (a errorMsgs) String() string {
|
||||
// Returns a new blank Engine instance without any middleware attached.
|
||||
// The most basic configuration
|
||||
func New() *Engine {
|
||||
engine := &Engine{}
|
||||
engine := &Engine{
|
||||
HTMLTemplates: template.New(""),
|
||||
}
|
||||
engine.RouterGroup = &RouterGroup{nil, "/", nil, engine}
|
||||
engine.router = httprouter.New()
|
||||
engine.router.NotFound = engine.handle404
|
||||
@ -141,7 +143,7 @@ func Default() *Engine {
|
||||
}
|
||||
|
||||
func (engine *Engine) LoadHTMLTemplates(pattern string) {
|
||||
engine.HTMLTemplates = template.Must(template.ParseGlob(pattern))
|
||||
engine.HTMLTemplates = template.Must(engine.HTMLTemplates.ParseGlob(pattern))
|
||||
}
|
||||
|
||||
// Adds handlers for NotFound. It return a 404 code by default.
|
||||
|
Loading…
x
Reference in New Issue
Block a user