Skip to content

Commit 4084b5e

Browse files
authored
Merge pull request #148 from luthermonson/golangci-lint-v1.55.2
upgrading golangci-lint to v1.55.2
2 parents cd35e2b + a6c0b3d commit 4084b5e

3 files changed

Lines changed: 12 additions & 15 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ codegen:
1717
.PHONY: lint
1818
lint:
1919
docker run --rm -v "$(shell pwd):/var/work:ro" -w /var/work \
20-
golangci/golangci-lint:v1.44.0 golangci-lint run -v --timeout=5m
20+
golangci/golangci-lint:v1.55.2 golangci-lint run -v --timeout=5m
2121

2222
.PHONY: fmt
2323
fmt:

cloud/linode/cloud.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func (c *linodeCloud) ProviderName() string {
104104
return ProviderName
105105
}
106106

107-
func (c *linodeCloud) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []string) {
107+
func (c *linodeCloud) ScrubDNS(_, _ []string) (nsOut, srchOut []string) {
108108
return nil, nil
109109
}
110110

cloud/linode/loadbalancers.go

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ func (l *loadbalancers) cleanupOldNodeBalancer(ctx context.Context, service *v1.
187187
// GetLoadBalancerName returns the name of the load balancer.
188188
//
189189
// GetLoadBalancer will not modify service.
190-
func (l *loadbalancers) GetLoadBalancerName(ctx context.Context, clusterName string, service *v1.Service) string {
190+
func (l *loadbalancers) GetLoadBalancerName(_ context.Context, _ string, _ *v1.Service) string {
191191
unixNano := strconv.FormatInt(time.Now().UnixNano(), 16)
192192
return fmt.Sprintf("ccm-%s", unixNano[len(unixNano)-12:])
193193
}
@@ -279,7 +279,7 @@ func (l *loadbalancers) updateNodeBalancer(ctx context.Context, service *v1.Serv
279279
}
280280
}
281281

282-
tags := l.getLoadbalancerTags(ctx, service)
282+
tags := l.getLoadBalancerTags(ctx, service)
283283
if !reflect.DeepEqual(nb.Tags, tags) {
284284
update := nb.GetUpdateOptions()
285285
update.Tags = &tags
@@ -504,7 +504,7 @@ func (l *loadbalancers) getNodeBalancerByID(ctx context.Context, service *v1.Ser
504504
return nb, nil
505505
}
506506

507-
func (l *loadbalancers) getLoadbalancerTags(ctx context.Context, service *v1.Service) []string {
507+
func (l *loadbalancers) getLoadBalancerTags(_ context.Context, service *v1.Service) []string {
508508
tagStr, ok := getServiceAnnotation(service, annLinodeLoadBalancerTags)
509509
if ok {
510510
return strings.Split(tagStr, ",")
@@ -516,7 +516,7 @@ func (l *loadbalancers) createNodeBalancer(ctx context.Context, clusterName stri
516516
connThrottle := getConnectionThrottle(service)
517517

518518
label := l.GetLoadBalancerName(ctx, clusterName, service)
519-
tags := l.getLoadbalancerTags(ctx, service)
519+
tags := l.getLoadBalancerTags(ctx, service)
520520
createOpts := linodego.NodeBalancerCreateOptions{
521521
Label: &label,
522522
Region: l.zone,
@@ -706,23 +706,20 @@ func getPortConfig(service *v1.Service, port int) (portConfig, error) {
706706
}
707707
protocol := portConfigAnnotation.Protocol
708708
if protocol == "" {
709-
var ok bool
710-
protocol, ok = service.Annotations[annLinodeDefaultProtocol]
711-
if !ok {
712-
protocol = "tcp"
709+
protocol = "tcp"
710+
if p, ok := service.Annotations[annLinodeDefaultProtocol]; ok {
711+
protocol = p
713712
}
714713
}
715714
protocol = strings.ToLower(protocol)
716715

717716
proxyProtocol := portConfigAnnotation.ProxyProtocol
718717
if proxyProtocol == "" {
719-
var ok bool
718+
proxyProtocol = string(linodego.ProxyProtocolNone)
720719
for _, ann := range []string{annLinodeDefaultProxyProtocol, annLinodeProxyProtocolDeprecated} {
721-
proxyProtocol, ok = service.Annotations[ann]
722-
if ok {
720+
if pp, ok := service.Annotations[ann]; ok {
721+
proxyProtocol = pp
723722
break
724-
} else {
725-
proxyProtocol = string(linodego.ProxyProtocolNone)
726723
}
727724
}
728725
}

0 commit comments

Comments
 (0)