Skip to content

Commit 05bd5f8

Browse files
authored
staticcheck: fix pipeline errors (#3190)
pipeline link: https://github.com/zalando/skipper/actions/runs/10387833964/job/28762375336\?pr\=3188 Signed-off-by: Mustafa Abdelrahman <[email protected]>
1 parent d6c49d7 commit 05bd5f8

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ func (c *Config) ToOptions() skipper.Options {
959959
options.ProxyFlags |= proxy.PatchPath
960960
}
961961

962-
if c.Certificates != nil && len(c.Certificates) > 0 {
962+
if len(c.Certificates) > 0 {
963963
options.ClientTLS = &tls.Config{
964964
Certificates: c.Certificates,
965965
MinVersion: c.getMinTLSVersion(),

filters/apiusagemonitoring/spec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ func (s *apiUsageMonitoringSpec) buildPathInfoListFromConfiguration(apis []*apiC
235235
continue
236236
}
237237

238-
if api.PathTemplates == nil || len(api.PathTemplates) == 0 {
238+
if len(api.PathTemplates) == 0 {
239239
s.warnf("args[%d] ignored: does not specify any path template", apiIndex)
240240
continue
241241
}

filters/tls/pass_client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func TestPassTLSClientCert_PEM(t *testing.T) {
199199
req, err := http.NewRequest(http.MethodGet, "http://example.com/foo", nil)
200200
require.NoError(t, err)
201201

202-
if test.certContents != nil && len(test.certContents) > 0 {
202+
if len(test.certContents) > 0 {
203203
req.TLS = buildTLSWith(test.certContents)
204204
}
205205

swarm/swarm.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"errors"
55
"fmt"
66
"io"
7+
"math"
78
"net"
89
"time"
910

@@ -156,7 +157,7 @@ func newKubernetesSwarm(o Options) (*Swarm, error) {
156157
}
157158
o.KubernetesOptions.KubernetesAPIBaseURL = u
158159

159-
if o.SwarmPort == 0 || o.SwarmPort >= 65535 {
160+
if o.SwarmPort == 0 || o.SwarmPort == math.MaxUint16 {
160161
log.Errorf("Wrong SwarmPort %d, set to default %d instead", o.SwarmPort, DefaultPort)
161162
o.SwarmPort = DefaultPort
162163
}

0 commit comments

Comments
 (0)