Skip to content

Commit 9a07004

Browse files
authored
Merge pull request #3290 from thaJeztah/fix_lint
fix some linting issues
2 parents 39ee904 + 1205802 commit 9a07004

File tree

5 files changed

+11
-15
lines changed

5 files changed

+11
-15
lines changed

bake/hclparser/gohcl/decode_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,11 +413,10 @@ func TestDecodeBody(t *testing.T) {
413413
} `hcl:"noodle,block"`
414414
}{}),
415415
func(gotI any) bool {
416-
//nolint:misspell
417416
// Generating two diagnostics is good enough for this one.
418417
// (one for the missing noodle block and the other for
419418
// the JSON serialization detecting the missing level of
420-
// heirarchy for the label.)
419+
// hierarchy for the label.)
421420
return true
422421
},
423422
2,

bake/hclparser/gohcl/schema.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ func ImpliedBodySchema(val any) (schema *hcl.BodySchema, partial bool) {
5252

5353
switch {
5454
case field.Type.AssignableTo(exprType):
55-
//nolint:misspell
56-
// If we're decoding to hcl.Expression then absense can be
55+
// If we're decoding to hcl.Expression then absence can be
5756
// indicated via a null value, so we don't specify that
5857
// the field is required during decoding.
5958
required = false

build/replicatedstream_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func TestSyncMultiReaderParallel(t *testing.T) {
4343
buf := make([]byte, bufferSize)
4444
for totalRead < len(data) {
4545
// Simulate random read sizes
46-
readSize := mathrand.Intn(bufferSize) //nolint:gosec
46+
readSize := mathrand.Intn(bufferSize) // #nosec G404 -- ignore "Use of weak random number generator (math/rand instead of crypto/rand)"
4747
n, err := reader.Read(buf[:readSize])
4848

4949
if n > 0 {
@@ -58,14 +58,15 @@ func TestSyncMultiReaderParallel(t *testing.T) {
5858

5959
assert.NoError(t, err, "Reader %d error", readerId)
6060

61-
if mathrand.Intn(1000) == 0 { //nolint:gosec
61+
// #nosec G404 -- ignore "Use of weak random number generator (math/rand instead of crypto/rand)"
62+
if mathrand.Intn(1000) == 0 {
6263
t.Logf("Reader %d closing", readerId)
6364
// Simulate random close
6465
return
6566
}
6667

6768
// Simulate random timing between reads
68-
time.Sleep(time.Millisecond * time.Duration(mathrand.Intn(5))) //nolint:gosec
69+
time.Sleep(time.Millisecond * time.Duration(mathrand.Intn(5))) // #nosec G404 -- ignore "Use of weak random number generator (math/rand instead of crypto/rand)"
6970
}
7071

7172
assert.Equal(t, len(data), totalRead, "Reader %d total read mismatch", readerId)

driver/kubernetes/podchooser/podchooser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func (pc *RandomPodChooser) ChoosePod(ctx context.Context) (*corev1.Pod, error)
3737
if randSource == nil {
3838
randSource = rand.NewSource(time.Now().Unix())
3939
}
40-
rnd := rand.New(randSource) //nolint:gosec // no strong seeding required
40+
rnd := rand.New(randSource) // #nosec G404 -- no strong seeding required
4141
n := rnd.Int() % len(pods)
4242
logrus.Debugf("RandomPodChooser.ChoosePod(): len(pods)=%d, n=%d", len(pods), n)
4343
return pods[n], nil

util/otelutil/span.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ type Span struct {
5959
Resource []attribute.KeyValue
6060
// InstrumentationLibrary is information about the library that produced
6161
// the span
62-
//nolint:staticcheck
63-
InstrumentationLibrary instrumentation.Library
62+
InstrumentationLibrary instrumentation.Scope
6463
}
6564

6665
type Spans []Span
@@ -112,8 +111,8 @@ type spanData struct {
112111
DroppedLinks int
113112
ChildSpanCount int
114113
Resource []keyValue // change this type from the otel type to make this struct marshallable
115-
//nolint:staticcheck
116-
InstrumentationLibrary instrumentation.Library
114+
115+
InstrumentationLibrary instrumentation.Scope
117116
}
118117

119118
// spanContext is a custom type used to unmarshal otel SpanContext correctly.
@@ -484,8 +483,6 @@ func (s spanSnapshot) InstrumentationScope() instrumentation.Scope {
484483
}
485484

486485
// InstrumentationLibrary returns the InstrumentationLibrary of the snapshot
487-
//
488-
//nolint:staticcheck
489-
func (s spanSnapshot) InstrumentationLibrary() instrumentation.Library {
486+
func (s spanSnapshot) InstrumentationLibrary() instrumentation.Scope {
490487
return s.instrumentationScope
491488
}

0 commit comments

Comments
 (0)