Skip to content

Commit d979be3

Browse files
committed
all: fix linters
Change-Id: I6e00020b02132c4af4bbf55115da13074230c826
1 parent 2a77929 commit d979be3

17 files changed

+22
-22
lines changed

errs2/ignore.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
// IsCanceled returns true, when the error is a cancellation.
1515
func IsCanceled(err error) bool {
1616
return errs.IsFunc(err, func(err error) bool {
17-
return err == context.Canceled || //nolint: errorlint, goerr113
17+
return err == context.Canceled || //nolint:errorlint, goerr113
1818
rpcstatus.Code(err) == rpcstatus.Canceled
1919
})
2020
}

ranger/httpranger/http.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func HTTPRanger(ctx context.Context, url string) (_ ranger.Ranger, err error) {
5757
// HTTPRangerSize creates an HTTPRanger with known size.
5858
// Use it if you know the content size. This will safe the extra HEAD request
5959
// for retrieving the content size.
60-
func HTTPRangerSize(url string, size int64) ranger.Ranger { // nolint:golint,revive
60+
func HTTPRangerSize(url string, size int64) ranger.Ranger { //nolint:golint,revive
6161
return &httpRanger{
6262
URL: url,
6363
size: size,

rpc/rpccache/cache_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ func runBenchmarkFilterSlice(b *testing.B, n int) {
416416
for i := 0; i < b.N; i++ {
417417
ent := ents[0]
418418
ents = filterEntry(ents, ent)
419-
ents = append(ents, ent) //nolint: makezero // the test removes from slice and adds it back
419+
ents = append(ents, ent) //nolint:makezero // the test removes from slice and adds it back
420420
}
421421
}
422422

socket/dscp.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ package socket
55

66
// A DSCP is a Differentiated Services Code Point.
77
//
8-
// nolint: unused
8+
//nolint:unused
99
type dscp byte
1010

1111
// See https://tools.ietf.org/html/rfc4594#section-2.3 for the definitions
1212
// of the below Differentiated Services Code Points.
1313
//
14-
// nolint: deadcode,varcheck,unused
14+
//nolint:deadcode,varcheck,unused
1515
const (
1616
dscpDF dscp = 0
1717
dscpCS6 dscp = 0b110000

storj/node_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,13 @@ func TestNodeID_String_Version(t *testing.T) {
146146

147147
func TestNodeID_Compare(t *testing.T) {
148148
var a storj.NodeID
149-
require.Equal(t, 0, a.Compare(a)) //nolint: gocritic
149+
require.Equal(t, 0, a.Compare(a)) //nolint:gocritic
150150

151151
for k := 0; k < len(storj.NodeID{}); k++ {
152152
var a, b storj.NodeID
153153
a[k], b[k] = 1, 2
154-
require.Equal(t, 0, a.Compare(a)) //nolint: gocritic
155-
require.Equal(t, 0, b.Compare(b)) //nolint: gocritic
154+
require.Equal(t, 0, a.Compare(a)) //nolint:gocritic
155+
require.Equal(t, 0, b.Compare(b)) //nolint:gocritic
156156
require.Equal(t, -1, a.Compare(b))
157157
require.Equal(t, 1, b.Compare(a))
158158
}

sync2/cooldown.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
//
2020
// Start or Run (only one of them, not both) must be only called once.
2121
type Cooldown struct {
22-
noCopy noCopy // nolint: structcheck
22+
noCopy noCopy //nolint:structcheck
2323

2424
stopsent int32
2525
runexec int32

sync2/cycle.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
//
2121
// Start or Run (only one of them, not both) must be only called once.
2222
type Cycle struct {
23-
noCopy noCopy // nolint: structcheck
23+
noCopy noCopy //nolint:structcheck
2424

2525
stopsent int32
2626
runexec int32

sync2/fence.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
// Fence allows to wait for something to happen.
1212
type Fence struct {
13-
noCopy noCopy // nolint: structcheck
13+
noCopy noCopy //nolint:structcheck
1414

1515
setup sync.Once
1616
release sync.Once

sync2/limiter.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
// After calling Wait or Close, no new goroutines are allowed
1414
// to start.
1515
type Limiter struct {
16-
noCopy noCopy // nolint: structcheck
16+
noCopy noCopy //nolint:structcheck
1717

1818
limit chan struct{}
1919
close sync.Once

sync2/nocopy.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ package sync2
88
//
99
// See https://golang.org/issues/8005#issuecomment-190753527.
1010
//
11-
// Currently users of noCopy must use "// nolint: structcheck",
11+
// Currently users of noCopy must use "//nolint:structcheck",
1212
// because golint-ci does not handle this correctly.
1313
type noCopy struct{}
1414

sync2/readcache.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
// ReadCache implements refreshing of state based on a refresh timeout,
1515
// but also allows for stale reads up to a certain duration.
1616
type ReadCache struct {
17-
noCopy noCopy // nolint: structcheck
17+
noCopy noCopy //nolint:structcheck
1818

1919
started Fence
2020
ctx context.Context

sync2/semaphore.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111

1212
// Semaphore implements a closable semaphore.
1313
type Semaphore struct {
14-
noCopy noCopy // nolint: structcheck
14+
noCopy noCopy //nolint:structcheck
1515

1616
ctx context.Context
1717
close func()

sync2/success_threshold.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
// It notifies the caller when reached a specific successful threshold without
1717
// interrupting the remaining tasks.
1818
type SuccessThreshold struct {
19-
noCopy noCopy // nolint: structcheck
19+
noCopy noCopy //nolint:structcheck
2020

2121
toSucceed int64
2222
pending int64

sync2/tee.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func NewTeeInmemory(readers int, blockSize int64) ([]PipeReader, PipeWriter, err
9191

9292
// tee synchronizes access to a shared buffer with one writer and multiple readers.
9393
type tee struct {
94-
noCopy noCopy // nolint: structcheck
94+
noCopy noCopy //nolint:structcheck
9595

9696
open *int64
9797

sync2/throttle.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
// Throttle implements two-sided throttling, between a consumer and producer.
1111
type Throttle struct {
12-
noCopy noCopy // nolint: structcheck
12+
noCopy noCopy //nolint:structcheck
1313

1414
mu sync.Mutex
1515
consumer sync.Cond

sync2/workgroup.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
// WorkGroup implements waitable and closable group of workers.
1111
type WorkGroup struct {
12-
noCopy noCopy // nolint: structcheck
12+
noCopy noCopy //nolint:structcheck
1313

1414
mu sync.Mutex
1515
cond sync.Cond

uuid/uuid_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,13 @@ func TestMarshal(t *testing.T) {
146146

147147
func TestCompare(t *testing.T) {
148148
var a uuid.UUID
149-
require.Equal(t, 0, a.Compare(a)) //nolint: gocritic
149+
require.Equal(t, 0, a.Compare(a)) //nolint:gocritic
150150

151151
for k := 0; k < len(uuid.UUID{}); k++ {
152152
var a, b uuid.UUID
153153
a[k], b[k] = 1, 2
154-
require.Equal(t, 0, a.Compare(a)) //nolint: gocritic
155-
require.Equal(t, 0, b.Compare(b)) //nolint: gocritic
154+
require.Equal(t, 0, a.Compare(a)) //nolint:gocritic
155+
require.Equal(t, 0, b.Compare(b)) //nolint:gocritic
156156
require.Equal(t, -1, a.Compare(b))
157157
require.Equal(t, 1, b.Compare(a))
158158
}

0 commit comments

Comments
 (0)