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

Vet and Lint the entire system (#296)

* govet and golint corrections
This commit is contained in:
Tom Limoncelli
2018-01-09 12:53:16 -05:00
committed by GitHub
parent 1a91a7f536
commit b7c251190f
64 changed files with 540 additions and 433 deletions

View File

@@ -1,21 +1,22 @@
//Package nameservers provides logic for dynamically finding nameservers for a domain, and configuring NS records for them.
// Package nameservers provides logic for dynamically finding nameservers for a domain, and configuring NS records for them.
package nameservers
import (
"fmt"
"strings"
"strconv"
"github.com/StackExchange/dnscontrol/models"
"github.com/StackExchange/dnscontrol/providers"
"github.com/miekg/dns/dnsutil"
"strconv"
)
//DetermineNameservers will find all nameservers we should use for a domain. It follows the following rules:
//1. All explicitly defined NAMESERVER records will be used.
//2. Each DSP declares how many nameservers to use. Default is all. 0 indicates to use none.
// DetermineNameservers will find all nameservers we should use for a domain. It follows the following rules:
// 1. All explicitly defined NAMESERVER records will be used.
// 2. Each DSP declares how many nameservers to use. Default is all. 0 indicates to use none.
func DetermineNameservers(dc *models.DomainConfig, maxNS int, dsps map[string]providers.DNSServiceProvider) ([]*models.Nameserver, error) {
//always take explicit
// always take explicit
ns := dc.Nameservers
for dsp, n := range dc.DNSProviders {
if n == 0 {
@@ -41,7 +42,7 @@ func DetermineNameservers(dc *models.DomainConfig, maxNS int, dsps map[string]pr
return ns, nil
}
//AddNSRecords creates NS records on a domain corresponding to the nameservers specified.
// AddNSRecords creates NS records on a domain corresponding to the nameservers specified.
func AddNSRecords(dc *models.DomainConfig) {
ttl := uint32(300)
if ttls, ok := dc.Metadata["ns_ttl"]; ok {