chore(deps): update golangci/golangci-lint docker tag to v2 #59

Merged
renovate merged 3 commits from renovate/golangci-golangci-lint-2.x into main 2025-04-18 16:13:52 +02:00
3 changed files with 4 additions and 1 deletions
Showing only changes of commit be915c8d38 - Show all commits

View file

@ -52,9 +52,11 @@ func NewRootCommand(c *config.Config) *cobra.Command {
} }
if c.JSONFormat { if c.JSONFormat {
//nolint:reassign // overwriting the default logger with the desired logger layout
log.Logger = logger.JSONLoggerLayout(os.Stderr) log.Logger = logger.JSONLoggerLayout(os.Stderr)
c.Logger = logger.JSONLoggerLayout(os.Stdout) c.Logger = logger.JSONLoggerLayout(os.Stdout)
} else { } else {
//nolint:reassign // overwriting the default logger with the desired logger layout
log.Logger = logger.CliLoggerLayout(os.Stderr) log.Logger = logger.CliLoggerLayout(os.Stderr)
c.Logger = logger.CliLoggerLayout(os.Stdout) c.Logger = logger.CliLoggerLayout(os.Stdout)
} }

View file

@ -10,6 +10,7 @@ import (
) )
func CliLoggerLayout(out io.Writer) zerolog.Logger { func CliLoggerLayout(out io.Writer) zerolog.Logger {
//nolint:reassign // overwriting the default caller layout with the desired layout
zerolog.CallerMarshalFunc = func(_ uintptr, file string, line int) string { zerolog.CallerMarshalFunc = func(_ uintptr, file string, line int) string {
return fmt.Sprintf("%s:%d", filepath.Base(file), line) return fmt.Sprintf("%s:%d", filepath.Base(file), line)
} }

View file

@ -109,9 +109,9 @@ func (c *Client) do(req *http.Request, v any) (*Response, error) {
return resp, err return resp, err
} }
defer httpResp.Body.Close() defer httpResp.Body.Close()
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body) body, err := io.ReadAll(resp.Body)
resp.Body.Close()
if err != nil { if err != nil {
return resp, err return resp, err
} }