update comments for golint

This commit is contained in:
foolin
2019-05-07 19:46:40 +08:00
parent 8f3973968f
commit e18578b643
3 changed files with 5 additions and 5 deletions

2
doc.go
View File

@@ -1,4 +1,4 @@
//package goview a lightweight, minimalist and idiomatic template library
//Package goview a lightweight, minimalist and idiomatic template library
//based on golang html/template for building Go web application.
//
//Example:

View File

@@ -57,7 +57,7 @@ func (v ViewRender) Render(w http.ResponseWriter) error {
func (v ViewRender) WriteContentType(w http.ResponseWriter) {
header := w.Header()
if val := header["Content-Type"]; len(val) == 0 {
header["Content-Type"] = goview.HtmlContentType
header["Content-Type"] = goview.HTMLContentType
}
}

View File

@@ -13,8 +13,8 @@ import (
"sync"
)
// HtmlContentType const templateEngineKey = "httpx_templateEngine"
var HtmlContentType = []string{"text/html; charset=utf-8"}
// HTMLContentType const templateEngineKey = "httpx_templateEngine"
var HTMLContentType = []string{"text/html; charset=utf-8"}
// DefaultConfig default config
var DefaultConfig = Config{
@@ -77,7 +77,7 @@ func Default() *ViewEngine {
func (e *ViewEngine) Render(w http.ResponseWriter, statusCode int, name string, data interface{}) error {
header := w.Header()
if val := header["Content-Type"]; len(val) == 0 {
header["Content-Type"] = HtmlContentType
header["Content-Type"] = HTMLContentType
}
w.WriteHeader(statusCode)
return e.executeRender(w, name, data)