mirror of
https://github.com/Monibuca/engine.git
synced 2025-10-06 17:16:55 +08:00
更新json序列化忽略字段
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
func ReturnJson[T any](fetch func() T, tickDur time.Duration, rw http.ResponseWriter, r *http.Request) {
|
||||
if r.URL.Query().Get("json") != "" {
|
||||
if err := json.NewEncoder(rw).Encode(fetch()); err != nil {
|
||||
rw.WriteHeader(500)
|
||||
http.Error(rw, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user