Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
dmachard committed Dec 20, 2024
1 parent 5b0ca7a commit 021d235
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dnsutils/dnsmessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ type PowerDNS struct {
InitialRequestorID string `json:"initial-requestor-id"`
RequestorID string `json:"requestor-id"`
DeviceName string `json:"device-name"`
DeviceId string `json:"device-id"`
DeviceID string `json:"device-id"`
}

type TransformDNSGeo struct {
Expand Down
2 changes: 1 addition & 1 deletion dnsutils/dnsmessage_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func (dm *DNSMessage) Flatten() (map[string]interface{}, error) {
dnsFields["powerdns.http-version"] = dm.PowerDNS.HTTPVersion
dnsFields["powerdns.message-id"] = dm.PowerDNS.MessageID
dnsFields["powerdns.requestor-id"] = dm.PowerDNS.RequestorID
dnsFields["powerdns.device-id"] = dm.PowerDNS.DeviceId
dnsFields["powerdns.device-id"] = dm.PowerDNS.DeviceID
dnsFields["powerdns.device-name"] = dm.PowerDNS.DeviceName
dnsFields["powerdns.initial-requestor-id"] = dm.PowerDNS.InitialRequestorID
}
Expand Down
2 changes: 1 addition & 1 deletion dnsutils/dnsmessage_json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func TestDnsMessage_Json_Collectors_Reference(t *testing.T) {
MessageID: "27c3e94ad6284eec9a50cfc5bd7384d6",
InitialRequestorID: "5e006236c8a74f7eafc6af126e6d0689",
RequestorID: "f7c3e94ad6284eec9a50cfc5bd7384d6",
DeviceId: "ffffffffffffffffeaaeaeae",
DeviceID: "ffffffffffffffffeaaeaeae",
DeviceName: "foobar",
}},

Expand Down
4 changes: 2 additions & 2 deletions dnsutils/dnsmessage_text.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ func (dm *DNSMessage) handlePdnsDirectives(directive string, s *strings.Builder)
s.WriteString("-")
}
case directive == "powerdns-device-id":
if len(dm.PowerDNS.DeviceId) > 0 {
s.WriteString(dm.PowerDNS.DeviceId)
if len(dm.PowerDNS.DeviceID) > 0 {
s.WriteString(dm.PowerDNS.DeviceID)
} else {
s.WriteString("-")
}
Expand Down
2 changes: 1 addition & 1 deletion dnsutils/dnsmessage_text_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ func TestDnsMessage_TextFormat_Directives_Pdns(t *testing.T) {
{
name: "device_id_name",
format: "powerdns-device-id powerdns-device-name",
dm: DNSMessage{PowerDNS: &PowerDNS{DeviceId: "5e006236c8a74f7eafc6af126e6d0689", DeviceName: "test"}},
dm: DNSMessage{PowerDNS: &PowerDNS{DeviceID: "5e006236c8a74f7eafc6af126e6d0689", DeviceName: "test"}},
expected: "5e006236c8a74f7eafc6af126e6d0689 test",
},
}
Expand Down

0 comments on commit 021d235

Please sign in to comment.