Skip to content

Commit

Permalink
staticcheck: fix pipeline errors (#3190)
Browse files Browse the repository at this point in the history
  • Loading branch information
MustafaSaber authored Aug 14, 2024
1 parent d6c49d7 commit 05bd5f8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ func (c *Config) ToOptions() skipper.Options {
options.ProxyFlags |= proxy.PatchPath
}

if c.Certificates != nil && len(c.Certificates) > 0 {
if len(c.Certificates) > 0 {
options.ClientTLS = &tls.Config{
Certificates: c.Certificates,
MinVersion: c.getMinTLSVersion(),
Expand Down
2 changes: 1 addition & 1 deletion filters/apiusagemonitoring/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ func (s *apiUsageMonitoringSpec) buildPathInfoListFromConfiguration(apis []*apiC
continue
}

if api.PathTemplates == nil || len(api.PathTemplates) == 0 {
if len(api.PathTemplates) == 0 {
s.warnf("args[%d] ignored: does not specify any path template", apiIndex)
continue
}
Expand Down
2 changes: 1 addition & 1 deletion filters/tls/pass_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func TestPassTLSClientCert_PEM(t *testing.T) {
req, err := http.NewRequest(http.MethodGet, "http://example.com/foo", nil)
require.NoError(t, err)

if test.certContents != nil && len(test.certContents) > 0 {
if len(test.certContents) > 0 {
req.TLS = buildTLSWith(test.certContents)
}

Expand Down
3 changes: 2 additions & 1 deletion swarm/swarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"io"
"math"
"net"
"time"

Expand Down Expand Up @@ -156,7 +157,7 @@ func newKubernetesSwarm(o Options) (*Swarm, error) {
}
o.KubernetesOptions.KubernetesAPIBaseURL = u

if o.SwarmPort == 0 || o.SwarmPort >= 65535 {
if o.SwarmPort == 0 || o.SwarmPort == math.MaxUint16 {
log.Errorf("Wrong SwarmPort %d, set to default %d instead", o.SwarmPort, DefaultPort)
o.SwarmPort = DefaultPort
}
Expand Down

0 comments on commit 05bd5f8

Please sign in to comment.