Simplify if block in fromAPIRecord

This commit is contained in:
Alexandre Almeida 2025-06-07 15:31:25 +02:00
parent 08474842cc
commit 7059813321

View File

@ -26,9 +26,7 @@ func fromAPIRecord(r govultr.DomainRecord, zone string) VultrRecord {
// Vultr uses a custom priority field for MX and SRV records // Vultr uses a custom priority field for MX and SRV records
data := r.Data data := r.Data
if r.Type == "MX" { if r.Type == "MX" || r.Type == "SRV" {
data = fmt.Sprintf("%d %s", r.Priority, r.Data)
} else if r.Type == "SRV" {
data = fmt.Sprintf("%d %s", r.Priority, r.Data) data = fmt.Sprintf("%d %s", r.Priority, r.Data)
} }