From ab0a6d6b2ad7ca3fe41a985fb5a46815e34dad5b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Oct 2025 11:57:41 +0000 Subject: [PATCH 1/2] build(deps): bump github.com/stbenjam/no-sprintf-host-port Bumps [github.com/stbenjam/no-sprintf-host-port](https://github.com/stbenjam/no-sprintf-host-port) from 0.2.0 to 0.3.1. - [Release notes](https://github.com/stbenjam/no-sprintf-host-port/releases) - [Commits](https://github.com/stbenjam/no-sprintf-host-port/compare/v0.2.0...v0.3.1) --- updated-dependencies: - dependency-name: github.com/stbenjam/no-sprintf-host-port dependency-version: 0.3.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8b039f996b0d..a5ac438eba66 100644 --- a/go.mod +++ b/go.mod @@ -114,7 +114,7 @@ require ( github.com/spf13/pflag v1.0.10 github.com/spf13/viper v1.12.0 github.com/ssgreg/nlreturn/v2 v2.2.1 - github.com/stbenjam/no-sprintf-host-port v0.2.0 + github.com/stbenjam/no-sprintf-host-port v0.3.1 github.com/stretchr/testify v1.11.1 github.com/tetafro/godot v1.5.4 github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67 diff --git a/go.sum b/go.sum index a8529bac9346..6cd49442cd43 100644 --- a/go.sum +++ b/go.sum @@ -563,8 +563,8 @@ github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ= github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YEwQ0= github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= -github.com/stbenjam/no-sprintf-host-port v0.2.0 h1:i8pxvGrt1+4G0czLr/WnmyH7zbZ8Bg8etvARQ1rpyl4= -github.com/stbenjam/no-sprintf-host-port v0.2.0/go.mod h1:eL0bQ9PasS0hsyTyfTjjG+E80QIyPnBVQbYZyv20Jfk= +github.com/stbenjam/no-sprintf-host-port v0.3.1 h1:AyX7+dxI4IdLBPtDbsGAyqiTSLpCP9hWRrXQDU4Cm/g= +github.com/stbenjam/no-sprintf-host-port v0.3.1/go.mod h1:ODbZesTCHMVKthBHskvUUexdcNHAQRXk9NpSsL8p/HQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= From 5b57d19b2c7a1dd7520af414c99d71f9cb90d9eb Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Thu, 30 Oct 2025 15:58:23 +0100 Subject: [PATCH 2/2] chore: update implementation --- .../nosprintfhostport/testdata/nosprintfhostport.go | 10 +++++----- .../testdata/nosprintfhostport_cgo.go | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pkg/golinters/nosprintfhostport/testdata/nosprintfhostport.go b/pkg/golinters/nosprintfhostport/testdata/nosprintfhostport.go index 065519e7de5f..820106c3eb4b 100644 --- a/pkg/golinters/nosprintfhostport/testdata/nosprintfhostport.go +++ b/pkg/golinters/nosprintfhostport/testdata/nosprintfhostport.go @@ -28,19 +28,19 @@ func _() { _ = fmt.Sprintf("http://example.com:9211") - _ = fmt.Sprintf("gopher://%s:%d", "myHost", 70) // want "host:port in url should be constructed with net.JoinHostPort and not directly with fmt.Sprintf" + _ = fmt.Sprintf("gopher://%s:%d", "myHost", 70) - _ = fmt.Sprintf("telnet+ssl://%s:%d", "myHost", 23) // want "host:port in url should be constructed with net.JoinHostPort and not directly with fmt.Sprintf" + _ = fmt.Sprintf("telnet+ssl://%s:%d", "myHost", 23) - _ = fmt.Sprintf("weird3.6://%s:%d", "myHost", 23) // want "host:port in url should be constructed with net.JoinHostPort and not directly with fmt.Sprintf" + _ = fmt.Sprintf("weird3.6://%s:%d", "myHost", 23) _ = fmt.Sprintf("https://user@%s:%d", "myHost", 8443) // want "host:port in url should be constructed with net.JoinHostPort and not directly with fmt.Sprintf" _ = fmt.Sprintf("postgres://%s:%s@%s:5050/%s", "foo", "bar", "baz", "qux") // want "host:port in url should be constructed with net.JoinHostPort and not directly with fmt.Sprintf" - _ = fmt.Sprintf("https://%s:%d", "myHost", 8443) // want "host:port in url should be constructed with net.JoinHostPort and not directly with fmt.Sprintf" + _ = fmt.Sprintf("https://%s:%d", "myHost", 8443) - _ = fmt.Sprintf("https://%s:9211", "myHost") // want "host:port in url should be constructed with net.JoinHostPort and not directly with fmt.Sprintf" + _ = fmt.Sprintf("https://%s:9211", "myHost") ip := "fd00::1" _ = fmt.Sprintf("http://%s:1936/healthz", ip) // want "host:port in url should be constructed with net.JoinHostPort and not directly with fmt.Sprintf" diff --git a/pkg/golinters/nosprintfhostport/testdata/nosprintfhostport_cgo.go b/pkg/golinters/nosprintfhostport/testdata/nosprintfhostport_cgo.go index b7548d10ec9a..d11b7dd1d3a7 100644 --- a/pkg/golinters/nosprintfhostport/testdata/nosprintfhostport_cgo.go +++ b/pkg/golinters/nosprintfhostport/testdata/nosprintfhostport_cgo.go @@ -23,5 +23,6 @@ func _() { } func _() { - _ = fmt.Sprintf("gopher://%s:%d", "myHost", 70) // want "host:port in url should be constructed with net.JoinHostPort and not directly with fmt.Sprintf" + ip := "fd00::1" + _ = fmt.Sprintf("http://%s:1936/healthz", ip) // want "host:port in url should be constructed with net.JoinHostPort and not directly with fmt.Sprintf" }