1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2026-06-03 18:35:08 +02:00

Fix gosec overflow alerts (#5799)

To allow the golangci-lint upgrade in #5796.

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
This commit is contained in:
Damien Mathieu
2024-09-13 09:11:50 +02:00
committed by GitHub
parent 5e3434c65a
commit a3c512aa95
26 changed files with 184 additions and 50 deletions
+2 -1
View File
@@ -76,7 +76,8 @@ func IntValue(v int) Value { return Int64Value(int64(v)) }
// Int64Value returns a [Value] for an int64.
func Int64Value(v int64) Value {
return Value{num: uint64(v), any: KindInt64}
// This can be later converted back to int64 (overflow not checked).
return Value{num: uint64(v), any: KindInt64} // nolint:gosec
}
// Float64Value returns a [Value] for a float64.
+1
View File
@@ -47,6 +47,7 @@ func TestValueEqual(t *testing.T) {
{},
log.Int64Value(1),
log.Int64Value(2),
log.Int64Value(-2),
log.Float64Value(3.5),
log.Float64Value(3.7),
log.BoolValue(true),