Skip to content

Commit 73ac499

Browse files
replicated-cigithub-actions[bot]Bishibop
authored
Bump Go from 1.24.6 to 1.25.4 (#1930)
* Bump Go to version from 1.24.6 to 1.25.4 * fix: use net.JoinHostPort for IPv6 compatibility Fix IPv6 address formatting in namespace-pinger.go by replacing fmt.Sprintf with net.JoinHostPort, which correctly handles both IPv4 and IPv6 addresses. Changes: - PingTCP: Use net.JoinHostPort for client connections - startTCPEchoServer: Use net.JoinHostPort for server listener This fixes go vet errors introduced by Go 1.25's stricter checks: address format "%s:%d" does not work with IPv6 IPv4 example: 192.168.1.1:8080 IPv6 example: [::1]:8080 (brackets added automatically) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Nicholas Mullen <nwmullen@gmail.com>
1 parent aa13c2e commit 73ac499

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/replicatedhq/troubleshoot
22

3-
go 1.24.6
3+
go 1.25.4
44

55
require (
66
github.com/Masterminds/sprig/v3 v3.3.0

pkg/namespaces/namespace-pinger.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package namespaces
55
import (
66
"fmt"
77
"net"
8+
"strconv"
89
"time"
910
)
1011

@@ -51,7 +52,7 @@ func (n *NamespacePinger) PingUDP(dst net.IP) error {
5152
func (n *NamespacePinger) PingTCP(dst net.IP) error {
5253
n.cfg.Logf("reaching to %q from %q with tcp", dst, n.InternalIP)
5354
pinger := func() error {
54-
addr := fmt.Sprintf("%s:%d", dst, n.cfg.Port)
55+
addr := net.JoinHostPort(dst.String(), strconv.Itoa(n.cfg.Port))
5556
conn, err := net.DialTimeout("tcp", addr, n.cfg.Timeout)
5657
if err != nil {
5758
return fmt.Errorf("error dialing tcp: %w", err)
@@ -90,7 +91,7 @@ func (n *NamespacePinger) StartTCPEchoServer(errors chan error) {
9091
// received, the server ends. Callers must wait until the ready channel is
9192
// closed before they can start sending packets.
9293
func (n *NamespacePinger) startTCPEchoServer(ready chan struct{}) (err error) {
93-
addr := fmt.Sprintf("%s:%d", n.InternalIP, n.cfg.Port)
94+
addr := net.JoinHostPort(n.InternalIP.String(), strconv.Itoa(n.cfg.Port))
9495
n.cfg.Logf("starting tcp echo server on namespace %q(%q)", n.name, addr)
9596

9697
if err = n.Join(); err != nil {

0 commit comments

Comments
 (0)