]> Cypherpunks repositories - gostls13.git/commitdiff
net: keep lookup IP stuff close
authorMikio Hara <mikioh.mikioh@gmail.com>
Sat, 31 Aug 2013 07:29:50 +0000 (16:29 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Sat, 31 Aug 2013 07:29:50 +0000 (16:29 +0900)
Also flattens import declaration.

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/13373046

src/pkg/net/lookup.go

index 0a10de239f818a2f3102b5e8f85e9d68a32b60b5..20f20578cded9ab74deb58e46f8ae6e462c16ca2 100644 (file)
@@ -4,9 +4,7 @@
 
 package net
 
-import (
-       "time"
-)
+import "time"
 
 // protocols contains minimal mappings between internet protocol
 // names and numbers for platforms that don't have a complete list of
@@ -21,6 +19,18 @@ var protocols = map[string]int{
        "ipv6-icmp": 58, "IPV6-ICMP": 58, "IPv6-ICMP": 58,
 }
 
+// LookupHost looks up the given host using the local resolver.
+// It returns an array of that host's addresses.
+func LookupHost(host string) (addrs []string, err error) {
+       return lookupHost(host)
+}
+
+// LookupIP looks up host using the local resolver.
+// It returns an array of that host's IPv4 and IPv6 addresses.
+func LookupIP(host string) (addrs []IP, err error) {
+       return lookupIPMerge(host)
+}
+
 var lookupGroup singleflight
 
 // lookupIPMerge wraps lookupIP, but makes sure that for any given
@@ -42,12 +52,6 @@ func lookupIPMerge(host string) (addrs []IP, err error) {
        return addrs, nil
 }
 
-// LookupHost looks up the given host using the local resolver.
-// It returns an array of that host's addresses.
-func LookupHost(host string) (addrs []string, err error) {
-       return lookupHost(host)
-}
-
 func lookupIPDeadline(host string, deadline time.Time) (addrs []IP, err error) {
        if deadline.IsZero() {
                return lookupIPMerge(host)
@@ -85,12 +89,6 @@ func lookupIPDeadline(host string, deadline time.Time) (addrs []IP, err error) {
        return
 }
 
-// LookupIP looks up host using the local resolver.
-// It returns an array of that host's IPv4 and IPv6 addresses.
-func LookupIP(host string) (addrs []IP, err error) {
-       return lookupIPMerge(host)
-}
-
 // LookupPort looks up the port for the given network and service.
 func LookupPort(network, service string) (port int, err error) {
        return lookupPort(network, service)