Skip to content

Commit 4875735

Browse files
renovate[bot]MrAliasdmathieu
authored
fix(deps): update module github.com/golangci/golangci-lint to v1.60.2 (#5711)
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [github.com/golangci/golangci-lint](https://togithub.com/golangci/golangci-lint) | `v1.60.1` -> `v1.60.2` | [![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fgolangci%2fgolangci-lint/v1.60.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fgolangci%2fgolangci-lint/v1.60.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fgolangci%2fgolangci-lint/v1.60.1/v1.60.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fgolangci%2fgolangci-lint/v1.60.1/v1.60.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>golangci/golangci-lint (github.com/golangci/golangci-lint)</summary> ### [`v1.60.2`](https://togithub.com/golangci/golangci-lint/compare/v1.60.1...v1.60.2) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.60.1...v1.60.2) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View the [repository job log](https://developer.mend.io/github/open-telemetry/opentelemetry-go). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguMjYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiU2tpcCBDaGFuZ2Vsb2ciLCJkZXBlbmRlbmNpZXMiXX0=--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Tyler Yahn <[email protected]> Co-authored-by: Tyler Yahn <[email protected]> Co-authored-by: Damien Mathieu <[email protected]>
1 parent 30fc407 commit 4875735

File tree

17 files changed

+123
-99
lines changed

17 files changed

+123
-99
lines changed

bridge/opencensus/internal/ocmetric/metric.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ func uintKV(key string, val uint) attribute.KeyValue {
301301
if val > uint(math.MaxInt) {
302302
return attribute.String(key, strconv.FormatUint(uint64(val), 10))
303303
}
304-
return attribute.Int(key, int(val))
304+
return attribute.Int(key, int(val)) // nolint: gosec // Overflow checked above.
305305
}
306306

307307
func uintSliceKV[N uint | uint8 | uint16 | uint32 | uint64 | uintptr](key string, val []N) attribute.KeyValue {
@@ -317,7 +317,7 @@ func uint64KV(key string, val uint64) attribute.KeyValue {
317317
if val > maxInt64 {
318318
return attribute.String(key, strconv.FormatUint(val, 10))
319319
}
320-
return attribute.Int64(key, int64(val))
320+
return attribute.Int64(key, int64(val)) // nolint: gosec // Overflow checked above.
321321
}
322322

323323
func complexSliceKV[N complex64 | complex128](key string, val []N) attribute.KeyValue {

bridge/opentracing/bridge.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ func otTagToOTelAttr(k string, v interface{}) attribute.KeyValue {
538538
case int8:
539539
return key.Int64(int64(val))
540540
case uint8:
541-
return key.Int64(int64(val))
541+
return key.Int64(int64(val)) // nolint: gosec // https://github.com/securego/gosec/issues/1185
542542
case int16:
543543
return key.Int64(int64(val))
544544
case uint16:

codes/codes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func (c *Code) UnmarshalJSON(b []byte) error {
8383
return fmt.Errorf("invalid code: %q", ci)
8484
}
8585

86-
*c = Code(ci)
86+
*c = Code(ci) // nolint: gosec // Bit size of 32 check above.
8787
return nil
8888
}
8989
return fmt.Errorf("invalid code: %q", string(b))

exporters/otlp/otlptrace/internal/tracetransform/span.go

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
package tracetransform // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform"
55

66
import (
7+
"math"
8+
79
"go.opentelemetry.io/otel/attribute"
810
"go.opentelemetry.io/otel/codes"
911
"go.opentelemetry.io/otel/sdk/instrumentation"
@@ -102,9 +104,9 @@ func span(sd tracesdk.ReadOnlySpan) *tracepb.Span {
102104
Name: sd.Name(),
103105
Attributes: KeyValues(sd.Attributes()),
104106
Events: spanEvents(sd.Events()),
105-
DroppedAttributesCount: uint32(sd.DroppedAttributes()),
106-
DroppedEventsCount: uint32(sd.DroppedEvents()),
107-
DroppedLinksCount: uint32(sd.DroppedLinks()),
107+
DroppedAttributesCount: clampUint32(sd.DroppedAttributes()),
108+
DroppedEventsCount: clampUint32(sd.DroppedEvents()),
109+
DroppedLinksCount: clampUint32(sd.DroppedLinks()),
108110
}
109111

110112
if psid := sd.Parent().SpanID(); psid.IsValid() {
@@ -115,6 +117,16 @@ func span(sd tracesdk.ReadOnlySpan) *tracepb.Span {
115117
return s
116118
}
117119

120+
func clampUint32(v int) uint32 {
121+
if v < 0 {
122+
return 0
123+
}
124+
if int64(v) > math.MaxUint32 {
125+
return math.MaxUint32
126+
}
127+
return uint32(v) // nolint: gosec // Overflow/Underflow checked.
128+
}
129+
118130
// status transform a span code and message into an OTLP span status.
119131
func status(status codes.Code, message string) *tracepb.Status {
120132
var c tracepb.Status_StatusCode
@@ -153,7 +165,7 @@ func links(links []tracesdk.Link) []*tracepb.Span_Link {
153165
TraceId: tid[:],
154166
SpanId: sid[:],
155167
Attributes: KeyValues(otLink.Attributes),
156-
DroppedAttributesCount: uint32(otLink.DroppedAttributeCount),
168+
DroppedAttributesCount: clampUint32(otLink.DroppedAttributeCount),
157169
Flags: flags,
158170
})
159171
}
@@ -182,7 +194,7 @@ func spanEvents(es []tracesdk.Event) []*tracepb.Span_Event {
182194
Name: es[i].Name,
183195
TimeUnixNano: uint64(es[i].Time.UnixNano()),
184196
Attributes: KeyValues(es[i].Attributes),
185-
DroppedAttributesCount: uint32(es[i].DroppedAttributeCount),
197+
DroppedAttributesCount: clampUint32(es[i].DroppedAttributeCount),
186198
}
187199
}
188200
return events

exporters/zipkin/model.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ func remoteEndpointPeerIPWithPort(peerIP string, portKey attribute.Key, attrs []
299299
for _, kv := range attrs {
300300
if kv.Key == portKey {
301301
port, _ := strconv.ParseUint(kv.Value.Emit(), 10, 16)
302-
endpoint.Port = uint16(port)
302+
endpoint.Port = uint16(port) // nolint: gosec // Bit size of 16 checked above.
303303
return endpoint
304304
}
305305
}

internal/rawhelpers.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ func Int64ToRaw(i int64) uint64 {
2424
}
2525

2626
func RawToInt64(r uint64) int64 {
27-
return int64(r)
27+
// Assumes original was a valid int64 (overflow not checked).
28+
return int64(r) // nolint: gosec
2829
}
2930

3031
func Float64ToRaw(f float64) uint64 {
@@ -36,9 +37,11 @@ func RawToFloat64(r uint64) float64 {
3637
}
3738

3839
func RawPtrToFloat64Ptr(r *uint64) *float64 {
39-
return (*float64)(unsafe.Pointer(r))
40+
// Assumes original was a valid *float64 (overflow not checked).
41+
return (*float64)(unsafe.Pointer(r)) // nolint: gosec
4042
}
4143

4244
func RawPtrToInt64Ptr(r *uint64) *int64 {
43-
return (*int64)(unsafe.Pointer(r))
45+
// Assumes original was a valid *int64 (overflow not checked).
46+
return (*int64)(unsafe.Pointer(r)) // nolint: gosec
4447
}

internal/tools/go.mod

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ toolchain go1.23.0
77
require (
88
github.com/client9/misspell v0.3.4
99
github.com/gogo/protobuf v1.3.2
10-
github.com/golangci/golangci-lint v1.60.1
10+
github.com/golangci/golangci-lint v1.60.2
1111
github.com/itchyny/gojq v0.12.16
1212
github.com/jcchavezs/porto v0.6.0
1313
github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad
@@ -88,7 +88,7 @@ require (
8888
github.com/gofrs/flock v0.12.1 // indirect
8989
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
9090
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect
91-
github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e // indirect
91+
github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9 // indirect
9292
github.com/golangci/misspell v0.6.0 // indirect
9393
github.com/golangci/modinfo v0.3.4 // indirect
9494
github.com/golangci/plugin-module-register v0.1.1 // indirect
@@ -162,7 +162,7 @@ require (
162162
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect
163163
github.com/sashamelentyev/interfacebloat v1.1.0 // indirect
164164
github.com/sashamelentyev/usestdlibvars v1.27.0 // indirect
165-
github.com/securego/gosec/v2 v2.20.1-0.20240525090044-5f0084eb01a9 // indirect
165+
github.com/securego/gosec/v2 v2.20.1-0.20240820084340-81cda2f91fbe // indirect
166166
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
167167
github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect
168168
github.com/sirupsen/logrus v1.9.3 // indirect
@@ -186,7 +186,7 @@ require (
186186
github.com/tetafro/godot v1.4.16 // indirect
187187
github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 // indirect
188188
github.com/timonwong/loggercheck v0.9.4 // indirect
189-
github.com/tomarrell/wrapcheck/v2 v2.8.3 // indirect
189+
github.com/tomarrell/wrapcheck/v2 v2.9.0 // indirect
190190
github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect
191191
github.com/ultraware/funlen v0.1.0 // indirect
192192
github.com/ultraware/whitespace v0.1.1 // indirect
@@ -211,12 +211,12 @@ require (
211211
golang.org/x/sys v0.23.0 // indirect
212212
golang.org/x/telemetry v0.0.0-20240522233618-39ace7a40ae7 // indirect
213213
golang.org/x/text v0.17.0 // indirect
214-
google.golang.org/protobuf v1.34.0 // indirect
214+
google.golang.org/protobuf v1.34.2 // indirect
215215
gopkg.in/ini.v1 v1.67.0 // indirect
216216
gopkg.in/warnings.v0 v0.1.2 // indirect
217217
gopkg.in/yaml.v2 v2.4.0 // indirect
218218
gopkg.in/yaml.v3 v3.0.1 // indirect
219-
honnef.co/go/tools v0.5.0 // indirect
220-
mvdan.cc/gofumpt v0.6.0 // indirect
219+
honnef.co/go/tools v0.5.1 // indirect
220+
mvdan.cc/gofumpt v0.7.0 // indirect
221221
mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f // indirect
222222
)

internal/tools/go.sum

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,10 @@ github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMj
130130
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII=
131131
github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys=
132132
github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY=
133-
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
134-
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
133+
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
134+
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
135+
github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI=
136+
github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow=
135137
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
136138
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
137139
github.com/go-toolsmith/astcast v1.1.0 h1:+JN9xZV1A+Re+95pgnMgDboWNVnIMMQXwfBwLRPgSC8=
@@ -167,10 +169,10 @@ github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l
167169
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
168170
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM=
169171
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk=
170-
github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e h1:ULcKCDV1LOZPFxGZaA6TlQbiM3J2GCPnkx/bGF6sX/g=
171-
github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e/go.mod h1:Pm5KhLPA8gSnQwrQ6ukebRcapGb/BG9iUkdaiCcGHJM=
172-
github.com/golangci/golangci-lint v1.60.1 h1:DRKNqNTQRLBJZ1il5u4fvgLQCjQc7QFs0DbhksJtVJE=
173-
github.com/golangci/golangci-lint v1.60.1/go.mod h1:jDIPN1rYaIA+ijp9OZcUmUCoQOtZ76pOlFbi15FlLJY=
172+
github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9 h1:/1322Qns6BtQxUZDTAT4SdcoxknUki7IAoK4SAXr8ME=
173+
github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9/go.mod h1:Oesb/0uFAyWoaw1U1qS5zyjCg5NP9C9iwjnI4tIsXEE=
174+
github.com/golangci/golangci-lint v1.60.2 h1:Y8aWnZCMOLY5T7Ga5hcoemyKsZZJCUmIIK3xTD3jIhc=
175+
github.com/golangci/golangci-lint v1.60.2/go.mod h1:4UvjLpOJoQSvmyWkmO1urDR3txhL9R9sn4oM/evJ95g=
174176
github.com/golangci/misspell v0.6.0 h1:JCle2HUTNWirNlDIAUO44hUsKhOFqGPoC4LZxlaSXDs=
175177
github.com/golangci/misspell v0.6.0/go.mod h1:keMNyY6R9isGaSAu+4Q8NMBwMPkh15Gtc8UCVoDtAWo=
176178
github.com/golangci/modinfo v0.3.4 h1:oU5huX3fbxqQXdfspamej74DFX0kyGLkw1ppvXoJ8GA=
@@ -190,8 +192,8 @@ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
190192
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
191193
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
192194
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
193-
github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg=
194-
github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw=
195+
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k=
196+
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo=
195197
github.com/google/renameio v0.1.0 h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA=
196198
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
197199
github.com/gordonklaus/ineffassign v0.1.0 h1:y2Gd/9I7MdY1oEIt+n+rowjBNDcLQq3RsH5hwJd0f9s=
@@ -306,10 +308,10 @@ github.com/nunnatsa/ginkgolinter v0.16.2 h1:8iLqHIZvN4fTLDC0Ke9tbSZVcyVHoBs0HIbn
306308
github.com/nunnatsa/ginkgolinter v0.16.2/go.mod h1:4tWRinDN1FeJgU+iJANW/kz7xKN5nYRAOfJDQUS9dOQ=
307309
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
308310
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
309-
github.com/onsi/ginkgo/v2 v2.17.3 h1:oJcvKpIb7/8uLpDDtnQuf18xVnwKp8DTD7DQ6gTd/MU=
310-
github.com/onsi/ginkgo/v2 v2.17.3/go.mod h1:nP2DPOQoNsQmsVyv5rDA8JkXQoCs6goXIvr/PRJ1eCc=
311-
github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk=
312-
github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0=
311+
github.com/onsi/ginkgo/v2 v2.20.0 h1:PE84V2mHqoT1sglvHc8ZdQtPcwmvvt29WLEEO3xmdZw=
312+
github.com/onsi/ginkgo/v2 v2.20.0/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI=
313+
github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k=
314+
github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY=
313315
github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw=
314316
github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU=
315317
github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w=
@@ -370,8 +372,8 @@ github.com/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tM
370372
github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84dxiN1iBi9+G8zZIhPVoNjQ=
371373
github.com/sashamelentyev/usestdlibvars v1.27.0 h1:t/3jZpSXtRPRf2xr0m63i32ZrusyurIGT9E5wAvXQnI=
372374
github.com/sashamelentyev/usestdlibvars v1.27.0/go.mod h1:9nl0jgOfHKWNFS43Ojw0i7aRoS4j6EBye3YBhmAIRF8=
373-
github.com/securego/gosec/v2 v2.20.1-0.20240525090044-5f0084eb01a9 h1:rnO6Zp1YMQwv8AyxzuwsVohljJgp4L0ZqiCgtACsPsc=
374-
github.com/securego/gosec/v2 v2.20.1-0.20240525090044-5f0084eb01a9/go.mod h1:dg7lPlu/xK/Ut9SedURCoZbVCR4yC7fM65DtH9/CDHs=
375+
github.com/securego/gosec/v2 v2.20.1-0.20240820084340-81cda2f91fbe h1:exdneYmXwZ4+VaIWv9mQ47uIHkTQSN50DYdCjXJ1cdQ=
376+
github.com/securego/gosec/v2 v2.20.1-0.20240820084340-81cda2f91fbe/go.mod h1:iyeMMRw8QEmueUSZ2VqmkQMiDyDcobfPnG00CV/NWdE=
375377
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
376378
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
377379
github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU=
@@ -437,8 +439,8 @@ github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 h1:quvGphlmUVU+n
437439
github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966/go.mod h1:27bSVNWSBOHm+qRp1T9qzaIpsWEP6TbUnei/43HK+PQ=
438440
github.com/timonwong/loggercheck v0.9.4 h1:HKKhqrjcVj8sxL7K77beXh0adEm6DLjV/QOGeMXEVi4=
439441
github.com/timonwong/loggercheck v0.9.4/go.mod h1:caz4zlPcgvpEkXgVnAJGowHAMW2NwHaNlpS8xDbVhTg=
440-
github.com/tomarrell/wrapcheck/v2 v2.8.3 h1:5ov+Cbhlgi7s/a42BprYoxsr73CbdMUTzE3bRDFASUs=
441-
github.com/tomarrell/wrapcheck/v2 v2.8.3/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo=
442+
github.com/tomarrell/wrapcheck/v2 v2.9.0 h1:801U2YCAjLhdN8zhZ/7tdjB3EnAoRlJHt/s+9hijLQ4=
443+
github.com/tomarrell/wrapcheck/v2 v2.9.0/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo=
442444
github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw=
443445
github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw=
444446
github.com/ultraware/funlen v0.1.0 h1:BuqclbkY6pO+cvxoq7OsktIXZpgBSkYTQtmwhAK81vI=
@@ -627,8 +629,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
627629
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
628630
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
629631
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
630-
google.golang.org/protobuf v1.34.0 h1:Qo/qEd2RZPCf2nKuorzksSknv0d3ERwp1vFG38gSmH4=
631-
google.golang.org/protobuf v1.34.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
632+
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
633+
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
632634
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
633635
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
634636
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
@@ -643,9 +645,9 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
643645
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
644646
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
645647
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
646-
honnef.co/go/tools v0.5.0 h1:29uoiIormS3Z6R+t56STz/oI4v+mB51TSmEOdJPgRnE=
647-
honnef.co/go/tools v0.5.0/go.mod h1:e9irvo83WDG9/irijV44wr3tbhcFeRnfpVlRqVwpzMs=
648-
mvdan.cc/gofumpt v0.6.0 h1:G3QvahNDmpD+Aek/bNOLrFR2XC6ZAdo62dZu65gmwGo=
649-
mvdan.cc/gofumpt v0.6.0/go.mod h1:4L0wf+kgIPZtcCWXynNS2e6bhmj73umwnuXSZarixzA=
648+
honnef.co/go/tools v0.5.1 h1:4bH5o3b5ZULQ4UrBmP+63W9r7qIkqJClEA9ko5YKx+I=
649+
honnef.co/go/tools v0.5.1/go.mod h1:e9irvo83WDG9/irijV44wr3tbhcFeRnfpVlRqVwpzMs=
650+
mvdan.cc/gofumpt v0.7.0 h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU=
651+
mvdan.cc/gofumpt v0.7.0/go.mod h1:txVFJy/Sc/mvaycET54pV8SW8gWxTlUuGHVEcncmNUo=
650652
mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f h1:lMpcwN6GxNbWtbpI1+xzFLSW8XzX0u72NttUGVFjO3U=
651653
mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f/go.mod h1:RSLa7mKKCNeTTMHBw5Hsy2rfJmd6O2ivt9Dw9ZqCQpQ=

log/keyvalue.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,10 @@ func (v Value) AsInt64() int64 {
146146

147147
// asInt64 returns the value held by v as an int64. If v is not of KindInt64,
148148
// this will return garbage.
149-
func (v Value) asInt64() int64 { return int64(v.num) }
149+
func (v Value) asInt64() int64 {
150+
// Assumes v.num was a valid int64 (overflow not checked).
151+
return int64(v.num) // nolint: gosec
152+
}
150153

151154
// AsBool returns the value held by v as a bool.
152155
func (v Value) AsBool() bool {
@@ -289,7 +292,8 @@ func (v Value) String() string {
289292
case KindString:
290293
return v.asString()
291294
case KindInt64:
292-
return strconv.FormatInt(int64(v.num), 10)
295+
// Assumes v.num was a valid int64 (overflow not checked).
296+
return strconv.FormatInt(int64(v.num), 10) // nolint: gosec
293297
case KindFloat64:
294298
return strconv.FormatFloat(v.asFloat64(), 'g', -1, 64)
295299
case KindBool:

sdk/log/logtest/factory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@ func (f RecordFactory) NewRecord() sdklog.Record {
7171
func set(r *sdklog.Record, name string, value any) {
7272
rVal := reflect.ValueOf(r).Elem()
7373
rf := rVal.FieldByName(name)
74-
rf = reflect.NewAt(rf.Type(), unsafe.Pointer(rf.UnsafeAddr())).Elem()
74+
rf = reflect.NewAt(rf.Type(), unsafe.Pointer(rf.UnsafeAddr())).Elem() // nolint: gosec // conversion of uintptr -> unsafe.Pointer.
7575
rf.Set(reflect.ValueOf(value))
7676
}

0 commit comments

Comments
 (0)