diff --git a/bridges/otelzap/encoder.go b/bridges/otelzap/encoder.go index e5b68850aac..a5ddfb48d32 100644 --- a/bridges/otelzap/encoder.go +++ b/bridges/otelzap/encoder.go @@ -175,7 +175,7 @@ func (m *objectEncoder) AddUint16(k string, v uint16) { } func (m *objectEncoder) AddUint8(k string, v uint8) { - m.AddInt64(k, int64(v)) // nolint: gosec // https://github.com/securego/gosec/issues/1185 + m.AddInt64(k, int64(v)) } func (m *objectEncoder) AddUintptr(k string, v uintptr) { @@ -272,10 +272,8 @@ func (a *arrayEncoder) AppendTime(v time.Time) { a.AppendInt64(v.UnixNan func (a *arrayEncoder) AppendUint(v uint) { a.AppendUint64(uint64(v)) } func (a *arrayEncoder) AppendUint32(v uint32) { a.AppendInt64(int64(v)) } func (a *arrayEncoder) AppendUint16(v uint16) { a.AppendInt64(int64(v)) } +func (a *arrayEncoder) AppendUint8(v uint8) { a.AppendInt64(int64(v)) } func (a *arrayEncoder) AppendUintptr(v uintptr) { a.AppendUint64(uint64(v)) } -func (a *arrayEncoder) AppendUint8(v uint8) { - a.AppendInt64(int64(v)) // nolint: gosec // https://github.com/securego/gosec/issues/1185 -} func convertValue(v interface{}) log.Value { switch v := v.(type) { diff --git a/config/resource.go b/config/resource.go index b61b033b852..020d6660b23 100644 --- a/config/resource.go +++ b/config/resource.go @@ -23,7 +23,7 @@ func keyVal(k string, v any) attribute.KeyValue { case int8: return attribute.Int64(k, int64(val)) case uint8: - return attribute.Int64(k, int64(val)) // nolint: gosec // https://github.com/securego/gosec/issues/1185 + return attribute.Int64(k, int64(val)) case int16: return attribute.Int64(k, int64(val)) case uint16: diff --git a/samplers/probability/consistent/sampler.go b/samplers/probability/consistent/sampler.go index 3bac7ec12d4..724160f6c82 100644 --- a/samplers/probability/consistent/sampler.go +++ b/samplers/probability/consistent/sampler.go @@ -161,8 +161,8 @@ func (cs *consistentProbabilityBased) ShouldSample(p sdktrace.SamplingParameters func (cs *consistentProbabilityBased) Description() string { var prob float64 if cs.lowLAC != pZeroValue { - prob = cs.lowProb * expToFloat64(-int(cs.lowLAC)) // nolint: gosec // https://github.com/securego/gosec/issues/1185 - prob += (1 - cs.lowProb) * expToFloat64(-int(cs.highLAC)) // nolint: gosec // https://github.com/securego/gosec/issues/1185 + prob = cs.lowProb * expToFloat64(-int(cs.lowLAC)) + prob += (1 - cs.lowProb) * expToFloat64(-int(cs.highLAC)) } return fmt.Sprintf("ProbabilityBased{%g}", prob) }