v0.0.349
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 1m51s

This commit is contained in:
2023-12-28 01:36:21 +01:00
parent 3188b951fb
commit 05580c384a
4 changed files with 183 additions and 7 deletions

View File

@@ -37,6 +37,14 @@ func (r GoJsonRender) Render(w http.ResponseWriter) error {
return nil
}
func (r GoJsonRender) RenderString() (string, error) {
jsonBytes, err := MarshalSafeCollections(r.Data, r.NilSafeSlices, r.NilSafeMaps, r.Indent, r.Filter)
if err != nil {
panic(err)
}
return string(jsonBytes), nil
}
func (r GoJsonRender) WriteContentType(w http.ResponseWriter) {
header := w.Header()
if val := header["Content-Type"]; len(val) == 0 {