From dac41ed65e18c85805384b918c30ba9403127dd8 Mon Sep 17 00:00:00 2001 From: "Marcel S. Henselin" Date: Mon, 29 Dec 2025 11:21:28 +0100 Subject: [PATCH] fix: fixed missing error handlers --- pkg/postgresflexalpha/api_default_test.go | 35 ++++++++++++++++++----- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/pkg/postgresflexalpha/api_default_test.go b/pkg/postgresflexalpha/api_default_test.go index 457899aa..baa87e6e 100644 --- a/pkg/postgresflexalpha/api_default_test.go +++ b/pkg/postgresflexalpha/api_default_test.go @@ -931,7 +931,10 @@ func Test_postgresflexalpha_DefaultApiService(t *testing.T) { testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := ListRolesResponse{} w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) + err := json.NewEncoder(w).Encode(data) + if err != nil { + return + } }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -989,7 +992,10 @@ func Test_postgresflexalpha_DefaultApiService(t *testing.T) { testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := ListUserResponse{} w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) + err := json.NewEncoder(w).Encode(data) + if err != nil { + return + } }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -1047,7 +1053,10 @@ func Test_postgresflexalpha_DefaultApiService(t *testing.T) { testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := RecoveryResponse{} w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) + err := json.NewEncoder(w).Encode(data) + if err != nil { + return + } }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -1105,7 +1114,10 @@ func Test_postgresflexalpha_DefaultApiService(t *testing.T) { testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := ProtectInstanceResponse{} w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) + err := json.NewEncoder(w).Encode(data) + if err != nil { + return + } }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -1166,7 +1178,10 @@ func Test_postgresflexalpha_DefaultApiService(t *testing.T) { testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := ResetUserResponse{} w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) + err := json.NewEncoder(w).Encode(data) + if err != nil { + return + } }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -1282,7 +1297,10 @@ func Test_postgresflexalpha_DefaultApiService(t *testing.T) { testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := UpdateDatabasePartiallyResponse{} w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) + err := json.NewEncoder(w).Encode(data) + if err != nil { + return + } }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -1344,7 +1362,10 @@ func Test_postgresflexalpha_DefaultApiService(t *testing.T) { testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := UpdateDatabaseResponse{} w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) + err := json.NewEncoder(w).Encode(data) + if err != nil { + return + } }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close()