Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
miekg committed Mar 23, 2013
1 parent 6e72a14 commit 6a928b3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dns.go
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (s byPriorityWeight) Less(i, j int) bool {
} }


// shuffleByWeight shuffles SRV records by weight using the algorithm // shuffleByWeight shuffles SRV records by weight using the algorithm
// described in RFC 2782. // described in RFC 2782.
func (addrs byPriorityWeight) shuffleByWeight() { func (addrs byPriorityWeight) shuffleByWeight() {
sum := 0 sum := 0
for _, addr := range addrs { for _, addr := range addrs {
Expand Down
4 changes: 2 additions & 2 deletions lookup.go
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
// They are adapted to the package unbound and the package dns. // They are adapted to the package unbound and the package dns.


// LookupAddr performs a reverse lookup for the given address, returning a // LookupAddr performs a reverse lookup for the given address, returning a
// list of names mapping to that address. // list of names mapping to that address.
func (u *Unbound) LookupAddr(addr string) (name []string, err error) { func (u *Unbound) LookupAddr(addr string) (name []string, err error) {
reverse, err := dns.ReverseAddr(addr) reverse, err := dns.ReverseAddr(addr)
if err != nil { if err != nil {
Expand Down Expand Up @@ -95,7 +95,7 @@ func (u *Unbound) LookupMX(name string) (mx []*dns.MX, err error) {
// LookupSRV tries to resolve an SRV query of the given service, protocol, // LookupSRV tries to resolve an SRV query of the given service, protocol,
// and domain name. The proto is "tcp" or "udp". The returned records are // and domain name. The proto is "tcp" or "udp". The returned records are
// sorted by priority and randomized by weight within a priority. // sorted by priority and randomized by weight within a priority.
// //
// LookupSRV constructs the DNS name to look up following RFC 2782. That // LookupSRV constructs the DNS name to look up following RFC 2782. That
// is, it looks up _service._proto.name. To accommodate services publishing // is, it looks up _service._proto.name. To accommodate services publishing
// SRV records under non-standard names, if both service and proto are // SRV records under non-standard names, if both service and proto are
Expand Down
6 changes: 3 additions & 3 deletions unbound.go
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ import (
) )


type Unbound struct { type Unbound struct {
ctx *C.struct_ctx ctx *C.struct_ctx
version [3]int version [3]int
} }


Expand Down Expand Up @@ -273,8 +273,8 @@ func (u *Unbound) Resolve(name string, rrtype, rrclass uint16) (*Result, error)
func (u *Unbound) ResolveAsync(name string, rrtype, rrclass uint16, c chan *ResultError) { func (u *Unbound) ResolveAsync(name string, rrtype, rrclass uint16, c chan *ResultError) {
go func() { go func() {
r, e := u.Resolve(name, rrtype, rrclass) r, e := u.Resolve(name, rrtype, rrclass)
c <- &ResultError{r, e} c <- &ResultError{r, e}
}() }()
return return
} }


Expand Down
6 changes: 3 additions & 3 deletions unbound_test.go
Original file line number Original file line Diff line number Diff line change
@@ -1,8 +1,8 @@
package unbound package unbound


import ( import (
"github.com/miekg/dns"
"fmt" "fmt"
"github.com/miekg/dns"
"testing" "testing"
) )


Expand Down Expand Up @@ -78,7 +78,7 @@ func TestUnicodeLookupHost(t *testing.T) {
} }


func TestUnicodeResolve(t *testing.T) { func TestUnicodeResolve(t *testing.T) {
u := New() u := New()
defer u.Destroy() defer u.Destroy()
if err := u.ResolvConf("/etc/resolv.conf"); err != nil { if err := u.ResolvConf("/etc/resolv.conf"); err != nil {
return return
Expand All @@ -88,7 +88,7 @@ func TestUnicodeResolve(t *testing.T) {
t.Log("Failure to get the A for ☁→❄→☃→☀→☺→☂→☹→✝.ws.") t.Log("Failure to get the A for ☁→❄→☃→☀→☺→☂→☹→✝.ws.")
t.Fail() t.Fail()
} }
if ! r.HaveData { if !r.HaveData {
t.Log("Failure to get the A for ☁→❄→☃→☀→☺→☂→☹→✝.ws.") t.Log("Failure to get the A for ☁→❄→☃→☀→☺→☂→☹→✝.ws.")
t.Fail() t.Fail()
} }
Expand Down

0 comments on commit 6a928b3

Please sign in to comment.