Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
bharathsreekanth committed Dec 13, 2024
1 parent 60c247b commit c20aa79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions api/api_logging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func TestWriteIndentedN(t *testing.T) {
}
}

func TestLogResponse(t *testing.T) {
func TestLogResponse(_ *testing.T) {
// Test case: Logging a successful response
res := &http.Response{
StatusCode: http.StatusOK,
Expand Down Expand Up @@ -234,17 +234,17 @@ func TestLogRequest(t *testing.T) {
}

// errorReader is a custom io.Reader that always returns an error when Read is called.
type errorReader struct {
type ErrorReader struct {
err error
}

// NewErrorReader creates an instance of errorReader with the specified error.
func NewErrorReader(err error) *errorReader {
return &errorReader{err: err}
func NewErrorReader(err error) *ErrorReader {
return &ErrorReader{err: err}
}

// Read always returns an error (simulating a read failure).
func (r *errorReader) Read(p []byte) (n int, err error) {
func (r *ErrorReader) Read(_ []byte) (n int, err error) {
return 0, r.err
}

Expand Down
2 changes: 1 addition & 1 deletion fault_set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ func TestGetFaultSetByName(t *testing.T) {
expectedErr: nil,
},
"bad request": {
server: httptest.NewServer(http.HandlerFunc(func(resp http.ResponseWriter, req *http.Request) {
server: httptest.NewServer(http.HandlerFunc(func(resp http.ResponseWriter, _ *http.Request) {
resp.WriteHeader(http.StatusBadRequest)
resp.Write([]byte(`{"message":"bad request","httpStatusCode":400,"errorCode":0}`))
})),
Expand Down

0 comments on commit c20aa79

Please sign in to comment.