update go to 1.20, bump deps

This commit is contained in:
Umputun
2023-08-07 13:03:16 -05:00
parent 7bc7703dc2
commit 2093f4ece2
582 changed files with 43315 additions and 12523 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ type ContentType int
// ContentTypes handled by this package.
const (
ContentTypeUnknown = iota
ContentTypeUnknown ContentType = iota
ContentTypePlainText
ContentTypeHTML
ContentTypeJSON
+2 -2
View File
@@ -99,14 +99,14 @@ func JSON(w http.ResponseWriter, r *http.Request, v interface{}) {
return
}
w.Header().Set("Content-Type", "application/json; charset=utf-8")
w.Header().Set("Content-Type", "application/json")
if status, ok := r.Context().Value(StatusCtxKey).(int); ok {
w.WriteHeader(status)
}
w.Write(buf.Bytes()) //nolint:errcheck
}
// XML marshals 'v' to JSON, setting the Content-Type as application/xml. It
// XML marshals 'v' to XML, setting the Content-Type as application/xml. It
// will automatically prepend a generic XML header (see encoding/xml.Header) if
// one is not found in the first 100 bytes of 'v'.
func XML(w http.ResponseWriter, r *http.Request, v interface{}) {