Skip to content

Commit 264309e

Browse files
committed
Bump to Go 1.24.2
Fixes #1460. This required fixing new `go vet` findings: ``` tunnelrpc/pogs/configuration_manager.go:99:22: non-constant format string in call to fmt.Errorf tunnelrpc/pogs/session_manager.go:130:22: non-constant format string in call to fmt.Errorf ingress/ingress.go:116:20: non-constant format string in call to (*github.com/rs/zerolog.Event).Msgf ingress/origin_proxy.go:77:21: non-constant format string in call to (*github.com/rs/zerolog.Event).Msgf cmd/cloudflared/tunnel/subcommands.go:764:31: non-constant format string in call to github.com/cloudflare/cloudflared/cmd/cloudflared/cliutil.UsageError ```
1 parent 40dc601 commit 264309e

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

cmd/cloudflared/tunnel/subcommands.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ func runCommand(c *cli.Context) error {
761761
if tokenFile := c.String(TunnelTokenFileFlag); tokenFile != "" {
762762
data, err := os.ReadFile(tokenFile)
763763
if err != nil {
764-
return cliutil.UsageError("Failed to read token file: " + err.Error())
764+
return cliutil.UsageError("Failed to read token file: %s", err.Error())
765765
}
766766
tokenStr = strings.TrimSpace(string(data))
767767
}

go.mod

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

3-
go 1.22
3+
go 1.24.2
44

55
require (
66
github.com/coredns/coredns v1.11.3

ingress/ingress.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func ParseIngressFromConfigAndCLI(conf *config.Configuration, c *cli.Context, lo
113113
// If no token is provided, the probability of NOT being a remotely managed tunnel is higher.
114114
// So, we should warn the user that no ingress rules were found, because remote configuration will most likely not exist.
115115
if !c.IsSet("token") {
116-
log.Warn().Msgf(ErrNoIngressRulesCLI.Error())
116+
log.Warn().Msg(ErrNoIngressRulesCLI.Error())
117117
}
118118
return newDefaultOrigin(c, log), nil
119119
}

ingress/origin_proxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func (o *httpService) SetOriginServerName(req *http.Request) {
7474

7575
func (o *statusCode) RoundTrip(_ *http.Request) (*http.Response, error) {
7676
if o.defaultResp {
77-
o.log.Warn().Msgf(ErrNoIngressRulesCLI.Error())
77+
o.log.Warn().Msg(ErrNoIngressRulesCLI.Error())
7878
}
7979
resp := &http.Response{
8080
StatusCode: o.code,

tunnelrpc/pogs/configuration_manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package pogs
22

33
import (
44
"context"
5-
"fmt"
5+
"errors"
66

77
capnp "zombiezen.com/go/capnproto2"
88
"zombiezen.com/go/capnproto2/rpc"
@@ -96,7 +96,7 @@ func (p *UpdateConfigurationResponse) Unmarshal(s proto.UpdateConfigurationRespo
9696
return err
9797
}
9898
if respErr != "" {
99-
p.Err = fmt.Errorf(respErr)
99+
p.Err = errors.New(respErr)
100100
}
101101
return nil
102102
}

tunnelrpc/pogs/session_manager.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package pogs
22

33
import (
44
"context"
5+
"errors"
56
"fmt"
67
"net"
78
"time"
@@ -127,7 +128,7 @@ func (p *RegisterUdpSessionResponse) Unmarshal(s proto.RegisterUdpSessionRespons
127128
return err
128129
}
129130
if respErr != "" {
130-
p.Err = fmt.Errorf(respErr)
131+
p.Err = errors.New(respErr)
131132
}
132133
p.Spans, err = s.Spans()
133134
if err != nil {

0 commit comments

Comments
 (0)