Skip to content

Commit

Permalink
Linters (#11)
Browse files Browse the repository at this point in the history
* Linters update
  • Loading branch information
soulgarden authored Mar 17, 2024
1 parent e3fe991 commit c346b6f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: 1.21.5
cache: false

- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type fields struct {
func startServer(t *testing.T, responseCode int, wantCreditsLeft, wantCreditsUsed int64, responseBody string) string {
t.Helper()

server := httptest.NewServer(http.HandlerFunc(func(cw http.ResponseWriter, sr *http.Request) {
server := httptest.NewServer(http.HandlerFunc(func(cw http.ResponseWriter, _ *http.Request) {
if responseCode == http.StatusInternalServerError {
cw.WriteHeader(responseCode)
}
Expand Down
2 changes: 1 addition & 1 deletion http_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (c *HTTPCli) logRequest(
var event *zerolog.Event

if err == nil {
event = c.logger.Debug()
event = c.logger.Debug() // nolint: zerologlint
} else {
event = c.logger.Err(err) // nolint: zerologlint
}
Expand Down
3 changes: 2 additions & 1 deletion ws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,15 @@ func TestWS_Subscribe(t *testing.T) {

server := httptest.NewServer(http.HandlerFunc(func(cw http.ResponseWriter, sr *http.Request) {
upgrader := websocket.Upgrader{
Error: func(w http.ResponseWriter, r *http.Request, status int, reason error) {
Error: func(w http.ResponseWriter, _ *http.Request, status int, reason error) {
http.Error(w, reason.Error(), status)
},
}

ws, err := upgrader.Upgrade(cw, sr, nil)
if err != nil {
t.Error(err)

_ = ws.Close()
}

Expand Down

0 comments on commit c346b6f

Please sign in to comment.