Skip to content

Commit

Permalink
runner: fix golang-lint issues
Browse files Browse the repository at this point in the history
Signed-off-by: Wei Fu <[email protected]>
  • Loading branch information
fuweid committed Jan 19, 2024
1 parent 562aee6 commit 816ac92
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions runner/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func (s *Server) Run() error {
wg.Add(1)
go func(l net.Listener) {
defer wg.Done()
//nolint:gosec
errCh <- http.Serve(l, r)
}(lis)
}
Expand All @@ -78,15 +79,15 @@ func (s *Server) Run() error {
}

// listRunnerGroupsHandler lists all the runner groups.
func (s *Server) listRunnerGroupsHandler(w http.ResponseWriter, r *http.Request) {
func (s *Server) listRunnerGroupsHandler(w http.ResponseWriter, _ *http.Request) {
res := make([]*types.RunnerGroup, 0, len(s.groups))
for _, g := range s.groups {
res = append(res, g.Info())
}

data, _ := json.Marshal(res)
w.WriteHeader(http.StatusOK)
w.Write(data)
_, _ = w.Write(data)
}

// getRunnerGroupsSummary returns summary report.
Expand All @@ -112,7 +113,7 @@ func (s *Server) getRunnerGroupsSummary(w http.ResponseWriter, r *http.Request)

data, _ := json.Marshal(s.report)
w.WriteHeader(http.StatusOK)
w.Write(data)
_, _ = w.Write(data)
}

// postRunnerGroupsRunnerResult receives summary result from runner.
Expand Down
2 changes: 1 addition & 1 deletion runner/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func renderErrorResponse(w http.ResponseWriter, code int, err error) {
data, _ := json.Marshal(types.HTTPError{
Error: err.Error(),
})
w.Write(data)
_, _ = w.Write(data)
}

// buildNetListeners returns slice of net.Listeners.
Expand Down

0 comments on commit 816ac92

Please sign in to comment.