mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-17 22:32:26 +08:00
code style adjust
This commit is contained in:
parent
6d89bec212
commit
b7500a8195
@ -29,6 +29,7 @@ type headerSource map[string][]string
|
|||||||
|
|
||||||
var _ setter = headerSource(nil)
|
var _ setter = headerSource(nil)
|
||||||
|
|
||||||
func (hs headerSource) TrySet(value reflect.Value, field reflect.StructField, tagValue string, opt setOptions) (isSetted bool, err error) {
|
func (hs headerSource) TrySet(value reflect.Value, field reflect.StructField, tagValue string,
|
||||||
|
opt setOptions) (bool, error) {
|
||||||
return setByForm(value, field, hs, textproto.CanonicalMIMEHeaderKey(tagValue), opt)
|
return setByForm(value, field, hs, textproto.CanonicalMIMEHeaderKey(tagValue), opt)
|
||||||
}
|
}
|
||||||
|
@ -46,9 +46,11 @@ type PureJSON struct {
|
|||||||
Data interface{}
|
Data interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
var jsonContentType = []string{"application/json; charset=utf-8"}
|
var (
|
||||||
var jsonpContentType = []string{"application/javascript; charset=utf-8"}
|
jsonContentType = []string{"application/json; charset=utf-8"}
|
||||||
var jsonAsciiContentType = []string{"application/json"}
|
jsonpContentType = []string{"application/javascript; charset=utf-8"}
|
||||||
|
jsonAsciiContentType = []string{"application/json"}
|
||||||
|
)
|
||||||
|
|
||||||
// Render (JSON) writes data with custom ContentType.
|
// Render (JSON) writes data with custom ContentType.
|
||||||
func (r JSON) Render(w http.ResponseWriter) (err error) {
|
func (r JSON) Render(w http.ResponseWriter) (err error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user