mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-09-05 04:34:32 +08:00
Rename RR() to ToRR().
This commit is contained in:
parent
5c282d819b
commit
0b34c42ff4
3 changed files with 3 additions and 3 deletions
|
@ -83,7 +83,7 @@ func (r *RecordConfig) String() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Convert RecordConfig -> dns.RR.
|
/// Convert RecordConfig -> dns.RR.
|
||||||
func (r *RecordConfig) RR() dns.RR {
|
func (r *RecordConfig) ToRR() dns.RR {
|
||||||
|
|
||||||
// Note: The label is a FQDN ending in a ".". It will not put "@" in the Name field.
|
// Note: The label is a FQDN ending in a ".". It will not put "@" in the Name field.
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ func TestRR(t *testing.T) {
|
||||||
Priority: 0,
|
Priority: 0,
|
||||||
}
|
}
|
||||||
expected := "foo.example.com.\t300\tIN\tA\t1.2.3.4"
|
expected := "foo.example.com.\t300\tIN\tA\t1.2.3.4"
|
||||||
found := experiment.RR().String()
|
found := experiment.ToRR().String()
|
||||||
if found != expected {
|
if found != expected {
|
||||||
t.Errorf("RR expected (%#v) got (%#v)\n", expected, found)
|
t.Errorf("RR expected (%#v) got (%#v)\n", expected, found)
|
||||||
}
|
}
|
||||||
|
|
|
@ -236,7 +236,7 @@ func (c *Bind) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Correcti
|
||||||
}
|
}
|
||||||
zonefilerecords := make([]dns.RR, 0, len(dc.Records))
|
zonefilerecords := make([]dns.RR, 0, len(dc.Records))
|
||||||
for _, r := range dc.Records {
|
for _, r := range dc.Records {
|
||||||
zonefilerecords = append(zonefilerecords, r.RR())
|
zonefilerecords = append(zonefilerecords, r.ToRR())
|
||||||
}
|
}
|
||||||
err = WriteZoneFile(zf, zonefilerecords, dc.Name)
|
err = WriteZoneFile(zf, zonefilerecords, dc.Name)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue