diff --git a/samplers/probability/consistent/base2.go b/samplers/probability/consistent/base2.go index de39fa5f861..193f7c32186 100644 --- a/samplers/probability/consistent/base2.go +++ b/samplers/probability/consistent/base2.go @@ -70,5 +70,5 @@ func splitProb(p float64) (uint8, uint8, float64) { highP := expToFloat64(-high) lowProb := (highP - p) / (highP - lowP) - return uint8(low), uint8(high), lowProb + return uint8(low), uint8(high), lowProb // nolint: gosec // 8-bit sample. } diff --git a/samplers/probability/consistent/sampler.go b/samplers/probability/consistent/sampler.go index 724160f6c82..1ceb02d3637 100644 --- a/samplers/probability/consistent/sampler.go +++ b/samplers/probability/consistent/sampler.go @@ -100,7 +100,7 @@ func ProbabilityBased(fraction float64, opts ...ProbabilityBasedOption) sdktrace func (cs *consistentProbabilityBased) newR() uint8 { cs.lock.Lock() defer cs.lock.Unlock() - return uint8(bits.LeadingZeros64(uint64(cs.rnd.Int63())) - 1) + return uint8(bits.LeadingZeros64(uint64(cs.rnd.Int63())) - 1) // nolint: gosec // 8-bit sample. } func (cs *consistentProbabilityBased) lowChoice() bool { diff --git a/samplers/probability/consistent/tracestate.go b/samplers/probability/consistent/tracestate.go index 4d01102867f..d531dfd1627 100644 --- a/samplers/probability/consistent/tracestate.go +++ b/samplers/probability/consistent/tracestate.go @@ -199,7 +199,7 @@ func parseNumber(key string, input string, maximum uint8) (uint8, error) { return maximum + 1, parseError(key, strconv.ErrRange) } // `value` is strictly less then the uint8 maximum. This cast is safe. - return uint8(value), nil + return uint8(value), nil // nolint: gosec } func parseError(key string, err error) error {