Skip to content

Commit

Permalink
chore: remove staticcheck from golangci-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
notanatol committed Jan 15, 2024
1 parent da5a1ba commit 1dac78d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ linters:
- prealloc
- predeclared
- promlinter
- staticcheck
- thelper
- typecheck
- unconvert
Expand Down
3 changes: 1 addition & 2 deletions pkg/api/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ type UpgradedResponseWriter interface {
http.Pusher
http.Hijacker
http.Flusher
// lint:ignore SA1019 CloseNotifier interface is required by gorilla compress handler
// nolint:staticcheck
//lint:ignore SA1019 CloseNotifier interface is required by gorilla compress handler
http.CloseNotifier

Check failure on line 112 in pkg/api/metrics.go

View workflow job for this annotation

GitHub Actions / Lint

SA1019: http.CloseNotifier has been deprecated since Go 1.11 and an alternative has been available since Go 1.7: the CloseNotifier interface predates Go's context package. New code should use Request.Context instead. (staticcheck)
}

Expand Down
3 changes: 1 addition & 2 deletions pkg/log/httpaccess/http_access.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ func (rr *responseRecorder) WriteHeader(s int) {

// CloseNotify implements http.CloseNotifier.
func (rr *responseRecorder) CloseNotify() <-chan bool {
// nolint:staticcheck
// lint:ignore SA1019 CloseNotifier interface is required by gorilla compress handler
//lint:ignore SA1019 CloseNotifier interface is required by gorilla compress handler
return rr.ResponseWriter.(http.CloseNotifier).CloseNotify()

Check failure on line 117 in pkg/log/httpaccess/http_access.go

View workflow job for this annotation

GitHub Actions / Lint

SA1019: http.CloseNotifier has been deprecated since Go 1.11 and an alternative has been available since Go 1.7: the CloseNotifier interface predates Go's context package. New code should use Request.Context instead. (staticcheck)
}

Expand Down
5 changes: 2 additions & 3 deletions pkg/p2p/libp2p/libp2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ import (

ocprom "contrib.go.opencensus.io/exporter/prometheus"
m2 "github.com/ethersphere/bee/pkg/metrics"
rcmgrObs "github.com/libp2p/go-libp2p/p2p/host/resource-manager"
"github.com/prometheus/client_golang/prometheus"
)

Expand Down Expand Up @@ -175,7 +174,7 @@ func New(ctx context.Context, signer beecrypto.Signer, networkID uint64, overlay
}

if o.Registry != nil {
rcmgrObs.MustRegisterWith(o.Registry)
rcmgr.MustRegisterWith(o.Registry)
}

_, err = ocprom.NewExporter(ocprom.Options{
Expand All @@ -201,7 +200,7 @@ func New(ctx context.Context, signer beecrypto.Signer, networkID uint64, overlay
// The resource manager expects a limiter, se we create one from our limits.
limiter := rcmgr.NewFixedLimiter(limits)

str, err := rcmgrObs.NewStatsTraceReporter()
str, err := rcmgr.NewStatsTraceReporter()
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/leveldbstore/recovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type obj struct {
}

func (o *obj) ID() string { return o.Key }
func (_ *obj) Namespace() string { return "obj" }
func (*obj) Namespace() string { return "obj" }
func (o *obj) Marshal() ([]byte, error) { return json.Marshal(o) }
func (o *obj) Unmarshal(buf []byte) error { return json.Unmarshal(buf, o) }
func (o *obj) Clone() storage.Item { return &obj{Key: o.Key, Val: slices.Clone(o.Val)} }
Expand Down

0 comments on commit 1dac78d

Please sign in to comment.