1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

Make it easier to add new Rtypes. (#169)

* NEW: docs/adding-new-rtypes.md
* Mark all "if" and "switch" statements with `#rtype_variations`
* Make consistent use of `default: panic()`
This commit is contained in:
Tom Limoncelli
2017-08-04 12:26:29 -07:00
committed by GitHub
parent f214fb4515
commit 2cbabd859b
9 changed files with 213 additions and 27 deletions

View File

@ -109,7 +109,7 @@ func rrFormat(zonename string, filename string, r io.Reader, defaultTTL uint32,
if !dsl { // TSV format:
fmt.Printf("%s\t%s\t%s\t%s\t%s\n", name, ttl, classStr, typeStr, target)
} else { // DSL format:
switch hdr.Rrtype {
switch hdr.Rrtype { // #rtype_variations
case dns.TypeMX:
m := strings.SplitN(target, "\t", 2)
target = m[0] + ", '" + m[1] + "'"