feat: fixed lint errors
This commit is contained in:
@@ -33,5 +33,8 @@ func (h *HomeHandler) handleHome(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
json.NewEncoder(w).Encode(response)
|
||||
if err := json.NewEncoder(w).Encode(response); err != nil {
|
||||
// Handle encoding error - we can't write an error response after headers
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,5 +39,8 @@ func (h *TimeHandler) handleTime(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
json.NewEncoder(w).Encode(response)
|
||||
if err := json.NewEncoder(w).Encode(response); err != nil {
|
||||
// Handle encoding error - we can't write an error response after headers
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user