Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency golangci/golangci-lint to v1.60.2 #305

Merged
merged 2 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ linters: # All available linters list: <https://golangci-lint.run/usage/linters/
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases
- errorlint # find code that will cause problems with the error wrapping scheme introduced in Go 1.13
- exhaustive # check exhaustiveness of enum switch statements
- exportloopref # checks for pointers to enclosing loop variables
- copyloopvar # detects places where loop variables are copied
- funlen # Tool for detection of long functions
- gci # Gci control golang package import order and make it always deterministic
- godot # Check if comments end in a period
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ENV GOPATH="/var/tmp/go"

RUN set -x \
# renovate: source=github-releases name=golangci/golangci-lint
&& GOLANGCI_LINT_VERSION="1.60.1" \
&& GOLANGCI_LINT_VERSION="1.60.2" \
&& wget -O- -nv "https://cdn.jsdelivr.net/gh/golangci/golangci-lint@v${GOLANGCI_LINT_VERSION}/install.sh" \
| sh -s -- -b /bin "v${GOLANGCI_LINT_VERSION}"

Expand Down
4 changes: 2 additions & 2 deletions internal/cli/build/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func NewCommand(log *logger.Logger) *cli.Command { //nolint:funlen,gocognit
}

func (cmd *command) Run( //nolint:funlen,gocognit
ctx context.Context,
_ context.Context,
log *logger.Logger,
cfg *config.Config,
) error {
Expand All @@ -176,7 +176,7 @@ func (cmd *command) Run( //nolint:funlen,gocognit
var outFilePath = path.Join(cmd.opt.targetDirAbsPath, templateName, code+".html")

if content, renderErr := appTemplate.Render(templateContent, appTemplate.Props{ //nolint:nestif
Code: uint16(codeAsUint),
Code: uint16(codeAsUint), //nolint:gosec
Message: codeDescription.Message,
Description: codeDescription.Description,
L10nDisabled: cfg.L10n.Disable,
Expand Down
6 changes: 3 additions & 3 deletions internal/cli/perftest/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ func NewCommand() *cli.Command { //nolint:funlen
var runTest = func(scriptContent string) error {
if stdOut, stdErr, err := wrkRunTest(ctx,
wrkBinPath,
uint16(c.Uint(threadsFlag.Name)),
uint16(c.Uint(connectionsFlag.Name)),
uint16(c.Uint(threadsFlag.Name)), //nolint:gosec
uint16(c.Uint(connectionsFlag.Name)), //nolint:gosec
c.Duration(durationFlag.Name),
uint16(c.Uint(portFlag.Name)),
uint16(c.Uint(portFlag.Name)), //nolint:gosec
scriptContent,
); err != nil {
var errData, _ = io.ReadAll(stdErr)
Expand Down
4 changes: 2 additions & 2 deletions internal/cli/serve/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ func NewCommand(log *logger.Logger) *cli.Command { //nolint:funlen,gocognit,gocy
Suggest: true,
Action: func(ctx context.Context, c *cli.Command) error {
cmd.opt.http.addr = c.String(addrFlag.Name)
cmd.opt.http.port = uint16(c.Uint(portFlag.Name))
cmd.opt.http.port = uint16(c.Uint(portFlag.Name)) //nolint:gosec
cmd.opt.http.readBufferSize = uint(c.Uint(readBufferSizeFlag.Name))
cfg.L10n.Disable = c.Bool(disableL10nFlag.Name)
cfg.DefaultCodeToRender = uint16(c.Uint(defaultCodeToRenderFlag.Name))
cfg.DefaultCodeToRender = uint16(c.Uint(defaultCodeToRenderFlag.Name)) //nolint:gosec
cfg.RespondWithSameHTTPCode = c.Bool(sendSameHTTPCodeFlag.Name)
cfg.RotationMode, _ = config.ParseRotationMode(c.String(rotationModeFlag.Name))
cfg.ShowDetails = c.Bool(showDetailsFlag.Name)
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/serve/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ func getFreeTcpPort(t *testing.T) uint16 {
<-time.After(5 * time.Millisecond)
}

return uint16(port)
return uint16(port) //nolint:gosec
}
4 changes: 2 additions & 2 deletions internal/http/handlers/error_page/code.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func extractCodeFromURL(url string) (uint16, bool) {
}

if code, err := strconv.ParseUint(fileName, 10, 16); err == nil && code > 0 && code < 999 {
return uint16(code), true
return uint16(code), true //nolint:gosec
}

return 0, false
Expand All @@ -47,7 +47,7 @@ func extractCodeFromHeaders(headers *fasthttp.RequestHeader) (uint16, bool) {
// HTTP status code returned by the request
if value := headers.Peek("X-Code"); len(value) > 0 && len(value) <= 3 {
if code, err := strconv.ParseUint(string(value), 10, 16); err == nil && code > 0 && code < 999 {
return uint16(code), true
return uint16(code), true //nolint:gosec
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func NewServer(log *logger.Logger, readBufferSize uint) Server {
server: &fasthttp.Server{
ReadTimeout: readTimeout,
WriteTimeout: writeTimeout,
ReadBufferSize: int(readBufferSize),
ReadBufferSize: int(readBufferSize), //nolint:gosec
DisablePreParseMultipartForm: true,
NoDefaultServerHeader: true,
CloseOnShutdown: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/http/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,5 +392,5 @@ func getFreeTcpPort(t *testing.T) uint16 {
<-time.After(5 * time.Millisecond)
}

return uint16(port)
return uint16(port) //nolint:gosec
}