Skip to content

Commit

Permalink
chore: invert if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
kashalls committed Oct 25, 2024
1 parent 28facb2 commit a7c1f18
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions internal/unifi/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,18 +171,19 @@ func (c *httpClient) GetEndpoints() ([]DNSRecord, error) {

// Loop through records to modify SRV type
for i, record := range records {
if record.RecordType == "SRV" {
// Modify the Target for SRV records
records[i].Value = fmt.Sprintf("%d %d %d %s",
record.Priority,
record.Weight,
record.Port,
record.Value,
)
records[i].Priority = 0
records[i].Weight = 0
records[i].Port = 0
if record.RecordType != "SRV" {
continue
}
// Modify the Target for SRV records
records[i].Value = fmt.Sprintf("%d %d %d %s",
record.Priority,
record.Weight,
record.Port,
record.Value,
)
records[i].Priority = 0
records[i].Weight = 0
records[i].Port = 0
}

log.Debug("retrieved records", zap.Int("count", len(records)))
Expand Down

0 comments on commit a7c1f18

Please sign in to comment.