Skip to content

Commit dd43e95

Browse files
committed
Bump golangci-lint from 1.56.2 to 1.62.2
1 parent 3a9de90 commit dd43e95

File tree

4 files changed

+31
-14
lines changed

4 files changed

+31
-14
lines changed

.errcheck.txt

Whitespace-only changes.

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
GO111MODULE="on" go install github.com/google/go-licenses@v1.0.0
4848
4949
# Install GolangCI linter: https://github.com/golangci/golangci-lint/
50-
GOLANGCI_VERSION=1.56.2
50+
GOLANGCI_VERSION=1.62.2
5151
curl -sL https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCI_VERSION}/golangci-lint-${GOLANGCI_VERSION}-linux-amd64.tar.gz | tar -C /usr/local/bin -xvzf - --strip-components=1 --wildcards "*/golangci-lint"
5252
5353
- name: Run tests

.golangci.yml

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
1+
# Documentation: https://golangci-lint.run/usage/configuration/
2+
13
linters-settings:
2-
errcheck:
3-
exclude: .errcheck.txt
4+
gomodguard:
5+
blocked:
6+
modules:
7+
- github.com/ghodss/yaml:
8+
recommendations:
9+
- sigs.k8s.io/yaml
10+
depguard:
11+
rules:
12+
prevent_unmaintained_packages:
13+
list-mode: lax # allow unless explicitely denied
14+
files:
15+
- $all
16+
- "!$test"
17+
allow:
18+
- $gostd
19+
deny:
20+
- pkg: io/ioutil
21+
desc: "replaced by io and os packages since Go 1.16: https://tip.golang.org/doc/go1.16#ioutil"
22+
- pkg: github.com/ghodss/yaml
23+
desc: "use sigs.k8s.io/yaml instead, to be consistent"
424
linters:
525
enable:
626
- bodyclose
@@ -42,6 +62,7 @@ linters:
4262
- cyclop
4363
- depguard
4464
- dupl
65+
- err113
4566
- exhaustruct
4667
- forcetypeassert
4768
- funlen
@@ -52,19 +73,20 @@ linters:
5273
- gocyclo
5374
- godot
5475
- godox
55-
- goerr113
5676
- gofumpt
57-
- gomnd
5877
- gomoddirectives
78+
- iface
5979
- ireturn
6080
- lll
6181
- mirror
82+
- mnd
6283
- nestif
6384
- nlreturn
6485
- nonamedreturns
6586
- paralleltest
6687
- prealloc
6788
- predeclared
89+
- recvcheck
6890
- revive
6991
- staticcheck
7092
- stylecheck
@@ -98,17 +120,12 @@ output:
98120
issues:
99121
exclude-dirs:
100122
- vendor
101-
exclude-rules:
102-
- path: _test\.go
103-
linters:
104-
- errcheck
105-
- gosec
106123
max-issues-per-linter: 0
107124
max-same-issues: 0
108125
include:
109126
# Enable off-by-default rules for revive requiring that all exported elements have a properly formatted comment.
110-
- EXC0012
111-
- EXC0014
127+
- EXC0012 # https://golangci-lint.run/usage/false-positives/#exc0012
128+
- EXC0014 # https://golangci-lint.run/usage/false-positives/#exc0014
112129
run:
113130
issues-exit-code: 1
114131
build-tags:

pkg/utils/proxy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2020-2022 The Tekton Authors
2+
Copyright 2020-2025 The Tekton Authors
33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.
55
You may obtain a copy of the License at
@@ -31,7 +31,7 @@ func Proxy(request *http.Request, response http.ResponseWriter, url string, clie
3131

3232
req = req.WithContext(request.Context())
3333

34-
if request.Method == "POST" || request.Method == "PATCH" || request.Method == "PUT" || request.Method == "DELETE" {
34+
if request.Method == http.MethodPost || request.Method == http.MethodPatch || request.Method == http.MethodPut || request.Method == http.MethodDelete {
3535
req.Header.Set("Content-Type", request.Header.Get("Content-Type"))
3636
}
3737

0 commit comments

Comments
 (0)