fix: resolve SSH key and errcheck linter issues
Deploy workflow fixes: - Add tr -d '\r' to strip carriage returns from SSH key - Set chmod 700 on .ssh directory for proper permissions - Suppress ssh-keyscan stderr output Handler code fixes: - Check json.Encode() return values in errors.go (2 locations) - Check json.Encode() return value in health.go - Add log import to health.go - Log encoding errors instead of silently ignoring Resolves: - "Load key: error in libcrypto" SSH deployment error - 3 errcheck linter warnings
This commit is contained in:
@@ -2,6 +2,7 @@ package handlers
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"log"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
@@ -35,5 +36,8 @@ func (h *HealthHandler) Check(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 {
|
||||
// Log error but don't change response status (already written)
|
||||
log.Printf("ERROR encoding health check response: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user