Skip to content

Commit 47afc44

Browse files
committed
chore: enable more linters
1 parent 03c0d20 commit 47afc44

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

.golangci.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,30 @@ linters:
1212
- errcheck
1313
- goconst
1414
- gocritic
15+
# TODO "upgrade" to gofumpt
1516
- gofmt
1617
- goimports
1718
- goprintffuncname
18-
# - gosec
19+
- gosec
1920
- gosimple
2021
- govet
2122
- ineffassign
23+
- makezero
2224
- misspell
2325
- nakedret
26+
- nilnil
2427
- nolintlint
28+
- nosprintfhostport
29+
- predeclared
2530
- revive
2631
- rowserrcheck
2732
- staticcheck
2833
- structcheck
2934
- stylecheck
35+
- tenv
3036
- typecheck
3137
- unconvert
32-
# - unparam
38+
- unused
3339
- varcheck
3440
- whitespace
3541

@@ -39,4 +45,4 @@ linters-settings:
3945
# TODO: re-enable after figuring out why runcommand fails on go-critic..
4046
- unlambda
4147
goconst:
42-
min-len: 5
48+
min-len: 5

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ require (
77
github.com/adrg/xdg v0.3.2
88
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d
99
github.com/gemalto/flume v0.12.0
10-
github.com/hashicorp/go-cleanhttp v0.5.1
1110
github.com/jedib0t/go-pretty/v6 v6.0.5
1211
github.com/m7shapan/cidr v0.0.0-20200427124835-7eba0889a5d2
1312
github.com/mattn/go-isatty v0.0.12
@@ -26,6 +25,7 @@ require (
2625
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
2726
github.com/davecgh/go-spew v1.1.1 // indirect
2827
github.com/fsnotify/fsnotify v1.4.9 // indirect
28+
github.com/hashicorp/go-cleanhttp v0.5.1 // indirect
2929
github.com/hashicorp/hcl v1.0.0 // indirect
3030
github.com/inconshreveable/mousetrap v1.0.0 // indirect
3131
github.com/kr/text v0.2.0 // indirect

internal/config/config.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package config
22

33
import (
44
"fmt"
5-
"net/http"
65
"path/filepath"
76
"strings"
87
"time"
@@ -13,7 +12,6 @@ import (
1312
"github.com/UpCloudLtd/upcloud-go-api/v4/upcloud/service"
1413
"github.com/adrg/xdg"
1514
"github.com/gemalto/flume"
16-
"github.com/hashicorp/go-cleanhttp"
1715
"github.com/spf13/pflag"
1816
"github.com/spf13/viper"
1917
)
@@ -173,13 +171,6 @@ func (s *Config) ClientTimeout() time.Duration {
173171
return s.viper.GetDuration(KeyClientTimeout)
174172
}
175173

176-
type transport struct{}
177-
178-
// RoundTrip implements http.RoundTripper
179-
func (t *transport) RoundTrip(req *http.Request) (*http.Response, error) {
180-
return cleanhttp.DefaultTransport().RoundTrip(req)
181-
}
182-
183174
// CreateService creates a new service instance and puts in the conf struct
184175
func (s *Config) CreateService() (internal.AllServices, error) {
185176
username := s.GetString("username")

internal/mock/mock.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//nolint:nilnil // Here nil, nil returns are used in not-implemented methods required to satisfy an interface
12
package mock
23

34
import (

0 commit comments

Comments
 (0)