Merge pull request #3290 from thaJeztah/fix_lint

fix some linting issues
This commit is contained in:
Tõnis Tiigi
2025-07-10 08:30:29 -07:00
committed by GitHub
5 changed files with 11 additions and 15 deletions
+1 -2
View File
@@ -413,11 +413,10 @@ func TestDecodeBody(t *testing.T) {
} `hcl:"noodle,block"`
}{}),
func(gotI any) bool {
//nolint:misspell
// Generating two diagnostics is good enough for this one.
// (one for the missing noodle block and the other for
// the JSON serialization detecting the missing level of
// heirarchy for the label.)
// hierarchy for the label.)
return true
},
2,
+1 -2
View File
@@ -52,8 +52,7 @@ func ImpliedBodySchema(val any) (schema *hcl.BodySchema, partial bool) {
switch {
case field.Type.AssignableTo(exprType):
//nolint:misspell
// If we're decoding to hcl.Expression then absense can be
// If we're decoding to hcl.Expression then absence can be
// indicated via a null value, so we don't specify that
// the field is required during decoding.
required = false
+4 -3
View File
@@ -43,7 +43,7 @@ func TestSyncMultiReaderParallel(t *testing.T) {
buf := make([]byte, bufferSize)
for totalRead < len(data) {
// Simulate random read sizes
readSize := mathrand.Intn(bufferSize) //nolint:gosec
readSize := mathrand.Intn(bufferSize) // #nosec G404 -- ignore "Use of weak random number generator (math/rand instead of crypto/rand)"
n, err := reader.Read(buf[:readSize])
if n > 0 {
@@ -58,14 +58,15 @@ func TestSyncMultiReaderParallel(t *testing.T) {
assert.NoError(t, err, "Reader %d error", readerId)
if mathrand.Intn(1000) == 0 { //nolint:gosec
// #nosec G404 -- ignore "Use of weak random number generator (math/rand instead of crypto/rand)"
if mathrand.Intn(1000) == 0 {
t.Logf("Reader %d closing", readerId)
// Simulate random close
return
}
// Simulate random timing between reads
time.Sleep(time.Millisecond * time.Duration(mathrand.Intn(5))) //nolint:gosec
time.Sleep(time.Millisecond * time.Duration(mathrand.Intn(5))) // #nosec G404 -- ignore "Use of weak random number generator (math/rand instead of crypto/rand)"
}
assert.Equal(t, len(data), totalRead, "Reader %d total read mismatch", readerId)
+1 -1
View File
@@ -37,7 +37,7 @@ func (pc *RandomPodChooser) ChoosePod(ctx context.Context) (*corev1.Pod, error)
if randSource == nil {
randSource = rand.NewSource(time.Now().Unix())
}
rnd := rand.New(randSource) //nolint:gosec // no strong seeding required
rnd := rand.New(randSource) // #nosec G404 -- no strong seeding required
n := rnd.Int() % len(pods)
logrus.Debugf("RandomPodChooser.ChoosePod(): len(pods)=%d, n=%d", len(pods), n)
return pods[n], nil
+4 -7
View File
@@ -59,8 +59,7 @@ type Span struct {
Resource []attribute.KeyValue
// InstrumentationLibrary is information about the library that produced
// the span
//nolint:staticcheck
InstrumentationLibrary instrumentation.Library
InstrumentationLibrary instrumentation.Scope
}
type Spans []Span
@@ -112,8 +111,8 @@ type spanData struct {
DroppedLinks int
ChildSpanCount int
Resource []keyValue // change this type from the otel type to make this struct marshallable
//nolint:staticcheck
InstrumentationLibrary instrumentation.Library
InstrumentationLibrary instrumentation.Scope
}
// spanContext is a custom type used to unmarshal otel SpanContext correctly.
@@ -484,8 +483,6 @@ func (s spanSnapshot) InstrumentationScope() instrumentation.Scope {
}
// InstrumentationLibrary returns the InstrumentationLibrary of the snapshot
//
//nolint:staticcheck
func (s spanSnapshot) InstrumentationLibrary() instrumentation.Library {
func (s spanSnapshot) InstrumentationLibrary() instrumentation.Scope {
return s.instrumentationScope
}