Fix examples NewClient() -> new(dns.Client)

This commit is contained in:
Miek Gieben 2012-05-26 10:31:44 +02:00
parent 7e2d4ac1d4
commit a550bf6d40
6 changed files with 7 additions and 8 deletions

View File

@ -15,7 +15,7 @@ func main() {
flag.Parse()
zone := flag.Arg(flag.NArg() - 1)
client := dns.NewClient()
client := new(dns.Client)
client.Net = "tcp"
m := new(dns.Msg)
if *serial > 0 {

View File

@ -18,7 +18,7 @@ func main() {
m := new(dns.Msg)
m.Question = make([]dns.Question, 1)
c := dns.NewClient()
c := new(dns.Client)
addr := addresses(conf, c, os.Args[1])
if len(addr) == 0 {

View File

@ -38,7 +38,7 @@ func main() {
}
nameserver = string([]byte(nameserver)[1:]) // chop off @
nameserver += ":" + strconv.Itoa(*port)
c := dns.NewClient()
c := new(dns.Client)
prints, _ := fingerPrintFromFile("data/q")
results := make([]*fingerprint, 0)
if *report {

View File

@ -20,7 +20,7 @@ func main() {
m.SetQuestion(dns.Fqdn(os.Args[1]), dns.TypeDNSKEY)
m.SetEdns0(2048, true)
c := dns.NewClient()
c := new(dns.Client)
r, _ := c.Exchange(m, conf.Servers[0]+":"+conf.Port)
if r == nil {
fmt.Printf("*** no answer received for %s\n", os.Args[1])

View File

@ -16,8 +16,7 @@ func main() {
// Error checking
config, _ := dns.ClientConfigFromFile("/etc/resolv.conf")
c := dns.NewClient()
c := new(dns.Client)
m := new(dns.Msg)
m.SetQuestion(dns.Fqdn(os.Args[1]), dns.TypeMX)
m.MsgHdr.RecursionDesired = true

View File

@ -137,7 +137,7 @@ Flags:
// We use the async query handling, just to show how it is to be used.
dns.HandleQuery(".", q)
dns.ListenAndQuery(nil)
c := dns.NewClient()
c := new(dns.Client)
if *tcp {
c.Net = "tcp"
if *four {
@ -351,7 +351,7 @@ func getRRset(l []dns.RR, name string, t uint16) []dns.RR {
// Get the key from the DNS (uses the local resolver) and return them.
// If nothing is found we return nil
func getKey(name string, keytag uint16, server string, tcp bool) *dns.RR_DNSKEY {
c := dns.NewClient()
c := new(dns.Client)
if tcp {
c.Net = "tcp"
}