Browse Source

*: fix goreportcard golint warnings

This commit applies fixes for the golint warnings shown on goreportcard.

Signed-off-by: Lucas Servén Marín <lserven@gmail.com>
master
Lucas Servén Marín 10 months ago
parent
commit
a54ee2da37
No known key found for this signature in database GPG Key ID: 586FEAF680DA74AD
5 changed files with 12 additions and 6 deletions
  1. +1
    -0
      endpoint/endpoint.go
  2. +3
    -3
      provider/aws_test.go
  3. +2
    -2
      provider/cloudflare_test.go
  4. +4
    -0
      provider/vultr.go
  5. +2
    -1
      source/routegroup.go

+ 1
- 0
endpoint/endpoint.go View File

@ -159,6 +159,7 @@ func NewEndpointWithTTL(dnsName, recordType string, ttl TTL, targets ...string)
}
}
// WithSetIdentifier applies the given set identifier to the endpoint.
func (e *Endpoint) WithSetIdentifier(setIdentifier string) *Endpoint {
e.SetIdentifier = setIdentifier
return e


+ 3
- 3
provider/aws_test.go View File

@ -184,11 +184,11 @@ func (r *Route53APIStub) ChangeResourceRecordSetsWithContext(ctx context.Context
change.ResourceRecordSet.AliasTarget.DNSName = aws.String(wildcardEscape(ensureTrailingDot(aws.StringValue(change.ResourceRecordSet.AliasTarget.DNSName))))
}
setId := ""
setID := ""
if change.ResourceRecordSet.SetIdentifier != nil {
setId = aws.StringValue(change.ResourceRecordSet.SetIdentifier)
setID = aws.StringValue(change.ResourceRecordSet.SetIdentifier)
}
key := aws.StringValue(change.ResourceRecordSet.Name) + "::" + aws.StringValue(change.ResourceRecordSet.Type) + "::" + setId
key := aws.StringValue(change.ResourceRecordSet.Name) + "::" + aws.StringValue(change.ResourceRecordSet.Type) + "::" + setID
switch aws.StringValue(change.Action) {
case route53.ChangeActionCreate:
if _, found := recordSets[key]; found {


+ 2
- 2
provider/cloudflare_test.go View File

@ -173,9 +173,9 @@ func (m *mockCloudFlareClient) ListZones(zoneID ...string) ([]cloudflare.Zone, e
result := []cloudflare.Zone{}
for zoneId, zoneName := range m.Zones {
for zoneID, zoneName := range m.Zones {
result = append(result, cloudflare.Zone{
ID: zoneId,
ID: zoneID,
Name: zoneName,
})
}


+ 4
- 0
provider/vultr.go View File

@ -36,6 +36,7 @@ const (
vultrTTL = 3600
)
// VultrProvider is an implementation of Provider for Vultr DNS.
type VultrProvider struct {
client govultr.Client
@ -43,6 +44,7 @@ type VultrProvider struct {
DryRun bool
}
// VultrChanges differentiates between ChangActions.
type VultrChanges struct {
Action string
@ -78,6 +80,7 @@ func (p *VultrProvider) Zones(ctx context.Context) ([]govultr.DNSDomain, error)
return zones, nil
}
// Records returns the list of records.
func (p *VultrProvider) Records(ctx context.Context) ([]*endpoint.Endpoint, error) {
zones, err := p.Zones(ctx)
if err != nil {
@ -201,6 +204,7 @@ func (p *VultrProvider) submitChanges(ctx context.Context, changes []*VultrChang
return nil
}
// ApplyChanges applies a given set of changes in a given zone.
func (p *VultrProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) error {
combinedChanges := make([]*VultrChanges, 0, len(changes.Create)+len(changes.UpdateNew)+len(changes.Delete))


+ 2
- 1
source/routegroup.go View File

@ -37,7 +37,8 @@ import (
)
const (
defaultIdleConnTimeout = 30 * time.Second
defaultIdleConnTimeout = 30 * time.Second
// DefaultRoutegroupVersion is the default version for route groups.
DefaultRoutegroupVersion = "zalando.org/v1"
routeGroupListResource = "/apis/%s/routegroups"
routeGroupNamespacedResource = "/apis/%s/namespaces/%s/routegroups"


Loading…
Cancel
Save