Optimize code adjust (#2700)

* setFormMap error of result

* adjust code for TrySet

* error export for type multipart.FileHeader

* code style adjust

* reflect code maping optimize

* Update form_mapping.go

Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: thinkerou <thinkerou@gmail.com>
This commit is contained in:
heige
2021-06-02 07:35:30 +08:00
committed by GitHub
parent 6703dea51c
commit 97a32b1de3
4 changed files with 29 additions and 11 deletions

View File

@ -46,9 +46,11 @@ type PureJSON struct {
Data interface{}
}
var jsonContentType = []string{"application/json; charset=utf-8"}
var jsonpContentType = []string{"application/javascript; charset=utf-8"}
var jsonAsciiContentType = []string{"application/json"}
var (
jsonContentType = []string{"application/json; charset=utf-8"}
jsonpContentType = []string{"application/javascript; charset=utf-8"}
jsonAsciiContentType = []string{"application/json"}
)
// Render (JSON) writes data with custom ContentType.
func (r JSON) Render(w http.ResponseWriter) (err error) {