Skip to content

Commit

Permalink
health check response struct name change (#832)
Browse files Browse the repository at this point in the history
Rename existing names used by other packages for lint
  • Loading branch information
taeng0204 committed Aug 5, 2024
1 parent 7ebe5f4 commit e615224
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions server/rpc/health/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"connectrpc.com/grpchealth"
)

// HealthCheckResponse represents the response structure for health checks.
type HealthCheckResponse struct {
// CheckResponse represents the response structure for health checks.
type CheckResponse struct {
Status string `json:"status"`
}

Expand All @@ -47,7 +47,7 @@ func NewHTTPHealthCheckHandler(checker grpchealth.Checker) (string, http.Handler
http.Error(w, err.Error(), http.StatusNotFound)
return
}
resp, err := json.Marshal(HealthCheckResponse{checkResponse.Status.String()})
resp, err := json.Marshal(CheckResponse{checkResponse.Status.String()})
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
Expand Down
2 changes: 1 addition & 1 deletion test/integration/health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestHTTPHealthCheck(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, resp.StatusCode, 200)

var healthResp health.HealthCheckResponse
var healthResp health.CheckResponse
err = json.NewDecoder(resp.Body).Decode(&healthResp)
assert.NoError(t, err)
assert.Equal(t, healthResp.Status, grpchealth.StatusServing.String())
Expand Down

0 comments on commit e615224

Please sign in to comment.