convert to go #3

Merged
luna merged 2 commits from convert-go into mistress 2026-01-11 22:32:29 +00:00
Showing only changes of commit f1ed70588c - Show all commits

View file

@ -140,7 +140,7 @@ func sendToDeepDanbooru(fileContents []byte, fileName, mimeType, threshold strin
return nil, fmt.Errorf("read response: %w", err)
}
slog.Info("dd body", "body", string(respBody))
slog.Debug("dd body", "body", string(respBody))
var result WrappedResponse
if err := json.Unmarshal(respBody, &result); err != nil {
@ -182,7 +182,7 @@ func sendToSDWebUI(fileContents []byte, fileName, mimeType, threshold string) (*
return nil, fmt.Errorf("read response: %w", err)
}
slog.Info("wd14 body", "body", string(respBody))
slog.Debug("wd14 body", "body", string(respBody))
var wd14Resp WD14Response
if err := json.Unmarshal(respBody, &wd14Resp); err != nil {
@ -227,7 +227,7 @@ func isVideo(contentType, fileName string) bool {
return false
}
func writeJSON(w http.ResponseWriter, v interface{}) {
func writeJSON(w http.ResponseWriter, v any) {
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(v)
}