refactor: go modernisation fixes

This commit is contained in:
sam committed 2026-08-29 00:20:05 +10:00
1 parent 8e4923991d
commit b2da85ead1
14 files changed
+41 -53

No files matched your search

+1 -2
View File
@@ -54,8 +54,7 @@ func (s *Server) handleWorkRequest(w http.ResponseWriter, r *http.Request) {
decoder := json.NewDecoder(r.Body)
decoder.DisallowUnknownFields()
if err := decoder.Decode(&request); err != nil {
var tooLarge *http.MaxBytesError
if errors.As(err, &tooLarge) {
if _, ok := errors.AsType[*http.MaxBytesError](err); ok {
http.Error(w, "work request body too large", http.StatusRequestEntityTooLarge)
return
}