From 994e0646d8f0d79fcf579357c1cf8027fe64a876 Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Tue, 17 Jan 2012 16:51:54 +1100 Subject: [PATCH] pkg: add missing godoc comments to windows versions Mostly copied comments from unix files. R=rsc CC=golang-dev https://golang.org/cl/5533057 --- src/buildscript_darwin_386.sh | 2 +- src/buildscript_darwin_amd64.sh | 2 +- src/buildscript_freebsd_386.sh | 2 +- src/buildscript_freebsd_amd64.sh | 2 +- src/buildscript_linux_386.sh | 2 +- src/buildscript_linux_amd64.sh | 2 +- src/buildscript_linux_arm.sh | 2 +- src/buildscript_netbsd_386.sh | 2 +- src/buildscript_netbsd_amd64.sh | 2 +- src/buildscript_openbsd_386.sh | 2 +- src/buildscript_openbsd_amd64.sh | 2 +- src/buildscript_plan9_386.sh | 2 +- src/buildscript_windows_386.sh | 2 +- src/buildscript_windows_amd64.sh | 2 +- src/pkg/net/Makefile | 1 + src/pkg/net/doc.go | 59 ++++++++++++++++++++++++++++++++ src/pkg/net/lookup_plan9.go | 38 +++++--------------- src/pkg/net/lookup_unix.go | 38 +++++--------------- src/pkg/net/lookup_windows.go | 25 +++++--------- src/pkg/os/Makefile | 1 + src/pkg/os/dir_plan9.go | 31 ++--------------- src/pkg/os/dir_unix.go | 14 +------- src/pkg/os/dir_windows.go | 2 +- src/pkg/os/doc.go | 52 ++++++++++++++++++++++++++++ src/pkg/os/exec/lp_windows.go | 5 +++ src/pkg/os/exec_plan9.go | 5 +-- src/pkg/os/exec_unix.go | 5 +-- src/pkg/os/exec_windows.go | 5 ++- src/pkg/os/file_unix.go | 17 +-------- src/pkg/os/file_windows.go | 17 +-------- src/pkg/os/sys_bsd.go | 2 +- src/pkg/os/sys_linux.go | 3 +- src/pkg/os/sys_plan9.go | 2 +- src/pkg/os/sys_windows.go | 2 +- 34 files changed, 172 insertions(+), 180 deletions(-) create mode 100644 src/pkg/net/doc.go create mode 100644 src/pkg/os/doc.go diff --git a/src/buildscript_darwin_386.sh b/src/buildscript_darwin_386.sh index f5d00898d6..42dbf5e17a 100755 --- a/src/buildscript_darwin_386.sh +++ b/src/buildscript_darwin_386.sh @@ -253,7 +253,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/darwin_386/time.a mkdir -p "$WORK"/os/_obj/ cd "$GOROOT"/src/pkg/os -8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_unix.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_darwin.go ./sys_bsd.go ./time.go ./types.go ./zsignal_darwin_386.go +8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_darwin.go ./sys_bsd.go ./time.go ./types.go ./zsignal_darwin_386.go gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.8 cp "$WORK"/os.a "$GOROOT"/pkg/darwin_386/os.a diff --git a/src/buildscript_darwin_amd64.sh b/src/buildscript_darwin_amd64.sh index 36d18aee6f..0766ff262c 100755 --- a/src/buildscript_darwin_amd64.sh +++ b/src/buildscript_darwin_amd64.sh @@ -252,7 +252,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/darwin_amd64/time.a mkdir -p "$WORK"/os/_obj/ cd "$GOROOT"/src/pkg/os -6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_unix.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_darwin.go ./sys_bsd.go ./time.go ./types.go ./zsignal_darwin_amd64.go +6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_darwin.go ./sys_bsd.go ./time.go ./types.go ./zsignal_darwin_amd64.go gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.6 cp "$WORK"/os.a "$GOROOT"/pkg/darwin_amd64/os.a diff --git a/src/buildscript_freebsd_386.sh b/src/buildscript_freebsd_386.sh index d482e6f57f..310f3dcf7b 100755 --- a/src/buildscript_freebsd_386.sh +++ b/src/buildscript_freebsd_386.sh @@ -253,7 +253,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/freebsd_386/time.a mkdir -p "$WORK"/os/_obj/ cd "$GOROOT"/src/pkg/os -8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_unix.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_freebsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_freebsd_386.go +8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_freebsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_freebsd_386.go gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.8 cp "$WORK"/os.a "$GOROOT"/pkg/freebsd_386/os.a diff --git a/src/buildscript_freebsd_amd64.sh b/src/buildscript_freebsd_amd64.sh index d24377b195..9a91017ac5 100755 --- a/src/buildscript_freebsd_amd64.sh +++ b/src/buildscript_freebsd_amd64.sh @@ -252,7 +252,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/freebsd_amd64/time.a mkdir -p "$WORK"/os/_obj/ cd "$GOROOT"/src/pkg/os -6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_unix.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_freebsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_freebsd_amd64.go +6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_freebsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_freebsd_amd64.go gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.6 cp "$WORK"/os.a "$GOROOT"/pkg/freebsd_amd64/os.a diff --git a/src/buildscript_linux_386.sh b/src/buildscript_linux_386.sh index ad8424253a..26009320ce 100755 --- a/src/buildscript_linux_386.sh +++ b/src/buildscript_linux_386.sh @@ -253,7 +253,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/linux_386/time.a mkdir -p "$WORK"/os/_obj/ cd "$GOROOT"/src/pkg/os -8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_unix.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_linux.go ./sys_linux.go ./time.go ./types.go ./zsignal_linux_386.go +8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_linux.go ./sys_linux.go ./time.go ./types.go ./zsignal_linux_386.go gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.8 cp "$WORK"/os.a "$GOROOT"/pkg/linux_386/os.a diff --git a/src/buildscript_linux_amd64.sh b/src/buildscript_linux_amd64.sh index e02b6f8a2f..f2eae0a59b 100755 --- a/src/buildscript_linux_amd64.sh +++ b/src/buildscript_linux_amd64.sh @@ -252,7 +252,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/linux_amd64/time.a mkdir -p "$WORK"/os/_obj/ cd "$GOROOT"/src/pkg/os -6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_unix.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_linux.go ./sys_linux.go ./time.go ./types.go ./zsignal_linux_amd64.go +6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_linux.go ./sys_linux.go ./time.go ./types.go ./zsignal_linux_amd64.go gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.6 cp "$WORK"/os.a "$GOROOT"/pkg/linux_amd64/os.a diff --git a/src/buildscript_linux_arm.sh b/src/buildscript_linux_arm.sh index 58027b8702..7589a5719e 100755 --- a/src/buildscript_linux_arm.sh +++ b/src/buildscript_linux_arm.sh @@ -256,7 +256,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/linux_arm/time.a mkdir -p "$WORK"/os/_obj/ cd "$GOROOT"/src/pkg/os -5g -o "$WORK"/os/_obj/_go_.5 -p os -I "$WORK" ./dir_unix.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_linux.go ./sys_linux.go ./time.go ./types.go ./zsignal_linux_arm.go +5g -o "$WORK"/os/_obj/_go_.5 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_linux.go ./sys_linux.go ./time.go ./types.go ./zsignal_linux_arm.go gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.5 cp "$WORK"/os.a "$GOROOT"/pkg/linux_arm/os.a diff --git a/src/buildscript_netbsd_386.sh b/src/buildscript_netbsd_386.sh index 1a2c43f3b9..8f9491c80f 100755 --- a/src/buildscript_netbsd_386.sh +++ b/src/buildscript_netbsd_386.sh @@ -253,7 +253,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/netbsd_386/time.a mkdir -p "$WORK"/os/_obj/ cd "$GOROOT"/src/pkg/os -8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_unix.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_netbsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_netbsd_386.go +8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_netbsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_netbsd_386.go gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.8 cp "$WORK"/os.a "$GOROOT"/pkg/netbsd_386/os.a diff --git a/src/buildscript_netbsd_amd64.sh b/src/buildscript_netbsd_amd64.sh index 7d6f647b64..be0053d066 100755 --- a/src/buildscript_netbsd_amd64.sh +++ b/src/buildscript_netbsd_amd64.sh @@ -252,7 +252,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/netbsd_amd64/time.a mkdir -p "$WORK"/os/_obj/ cd "$GOROOT"/src/pkg/os -6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_unix.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_netbsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_netbsd_amd64.go +6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_netbsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_netbsd_amd64.go gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.6 cp "$WORK"/os.a "$GOROOT"/pkg/netbsd_amd64/os.a diff --git a/src/buildscript_openbsd_386.sh b/src/buildscript_openbsd_386.sh index 2b44b08af0..30ddec6a5d 100755 --- a/src/buildscript_openbsd_386.sh +++ b/src/buildscript_openbsd_386.sh @@ -253,7 +253,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/openbsd_386/time.a mkdir -p "$WORK"/os/_obj/ cd "$GOROOT"/src/pkg/os -8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_unix.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_openbsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_openbsd_386.go +8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_openbsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_openbsd_386.go gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.8 cp "$WORK"/os.a "$GOROOT"/pkg/openbsd_386/os.a diff --git a/src/buildscript_openbsd_amd64.sh b/src/buildscript_openbsd_amd64.sh index ea3fca3853..c315d59e16 100755 --- a/src/buildscript_openbsd_amd64.sh +++ b/src/buildscript_openbsd_amd64.sh @@ -252,7 +252,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/openbsd_amd64/time.a mkdir -p "$WORK"/os/_obj/ cd "$GOROOT"/src/pkg/os -6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_unix.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_openbsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_openbsd_amd64.go +6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_openbsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_openbsd_amd64.go gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.6 cp "$WORK"/os.a "$GOROOT"/pkg/openbsd_amd64/os.a diff --git a/src/buildscript_plan9_386.sh b/src/buildscript_plan9_386.sh index f4e2050f52..10a24724f1 100755 --- a/src/buildscript_plan9_386.sh +++ b/src/buildscript_plan9_386.sh @@ -253,7 +253,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/plan9_386/time.a mkdir -p "$WORK"/os/_obj/ cd "$GOROOT"/src/pkg/os -8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_plan9.go ./env.go ./error.go ./error_plan9.go ./exec.go ./exec_plan9.go ./file.go ./file_plan9.go ./getwd.go ./path.go ./path_plan9.go ./proc.go ./stat_plan9.go ./str.go ./sys_plan9.go ./time.go ./types.go +8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_plan9.go ./doc.go ./env.go ./error.go ./error_plan9.go ./exec.go ./exec_plan9.go ./file.go ./file_plan9.go ./getwd.go ./path.go ./path_plan9.go ./proc.go ./stat_plan9.go ./str.go ./sys_plan9.go ./time.go ./types.go gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.8 cp "$WORK"/os.a "$GOROOT"/pkg/plan9_386/os.a diff --git a/src/buildscript_windows_386.sh b/src/buildscript_windows_386.sh index dc104dc364..b5e79288bd 100755 --- a/src/buildscript_windows_386.sh +++ b/src/buildscript_windows_386.sh @@ -265,7 +265,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/windows_386/time.a mkdir -p "$WORK"/os/_obj/ cd "$GOROOT"/src/pkg/os -8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_windows.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_windows.go ./file.go ./file_posix.go ./file_windows.go ./getwd.go ./path.go ./path_windows.go ./proc.go ./stat_windows.go ./sys_windows.go ./time.go ./types.go ./zsignal_windows_386.go +8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_windows.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_windows.go ./file.go ./file_posix.go ./file_windows.go ./getwd.go ./path.go ./path_windows.go ./proc.go ./stat_windows.go ./sys_windows.go ./time.go ./types.go ./zsignal_windows_386.go gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.8 cp "$WORK"/os.a "$GOROOT"/pkg/windows_386/os.a diff --git a/src/buildscript_windows_amd64.sh b/src/buildscript_windows_amd64.sh index 0bfb4a517f..bf87f6af98 100755 --- a/src/buildscript_windows_amd64.sh +++ b/src/buildscript_windows_amd64.sh @@ -264,7 +264,7 @@ cp "$WORK"/time.a "$GOROOT"/pkg/windows_amd64/time.a mkdir -p "$WORK"/os/_obj/ cd "$GOROOT"/src/pkg/os -6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_windows.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_windows.go ./file.go ./file_posix.go ./file_windows.go ./getwd.go ./path.go ./path_windows.go ./proc.go ./stat_windows.go ./sys_windows.go ./time.go ./types.go ./zsignal_windows_amd64.go +6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_windows.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_windows.go ./file.go ./file_posix.go ./file_windows.go ./getwd.go ./path.go ./path_windows.go ./proc.go ./stat_windows.go ./sys_windows.go ./time.go ./types.go ./zsignal_windows_amd64.go gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.6 cp "$WORK"/os.a "$GOROOT"/pkg/windows_amd64/os.a diff --git a/src/pkg/net/Makefile b/src/pkg/net/Makefile index 81df2a266c..a02798c73e 100644 --- a/src/pkg/net/Makefile +++ b/src/pkg/net/Makefile @@ -9,6 +9,7 @@ GOFILES=\ dial.go\ dnsclient.go\ dnsmsg.go\ + doc.go\ hosts.go\ interface.go\ ip.go\ diff --git a/src/pkg/net/doc.go b/src/pkg/net/doc.go new file mode 100644 index 0000000000..3a44e528eb --- /dev/null +++ b/src/pkg/net/doc.go @@ -0,0 +1,59 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package net + +// 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 lookupIP(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) +} + +// LookupCNAME returns the canonical DNS host for the given name. +// Callers that do not care about the canonical name can call +// LookupHost or LookupIP directly; both take care of resolving +// the canonical name as part of the lookup. +func LookupCNAME(name string) (cname string, err error) { + return lookupCNAME(name) +} + +// 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 sorted by priority and randomized +// by weight within a priority. +// +// LookupSRV constructs the DNS name to look up following RFC 2782. +// That is, it looks up _service._proto.name. To accommodate services +// publishing SRV records under non-standard names, if both service +// and proto are empty strings, LookupSRV looks up name directly. +func LookupSRV(service, proto, name string) (cname string, addrs []*SRV, err error) { + return lookupSRV(service, proto, name) +} + +// LookupMX returns the DNS MX records for the given domain name sorted by preference. +func LookupMX(name string) (mx []*MX, err error) { + return lookupMX(name) +} + +// LookupTXT returns the DNS TXT records for the given domain name. +func LookupTXT(name string) (txt []string, err error) { + return lookupTXT(name) +} + +// LookupAddr performs a reverse lookup for the given address, returning a list +// of names mapping to that address. +func LookupAddr(addr string) (name []string, err error) { + return lookupAddr(addr) +} diff --git a/src/pkg/net/lookup_plan9.go b/src/pkg/net/lookup_plan9.go index 027794a5e4..645aa6d249 100644 --- a/src/pkg/net/lookup_plan9.go +++ b/src/pkg/net/lookup_plan9.go @@ -69,9 +69,7 @@ func queryDNS(addr string, typ string) (res []string, err error) { return query("/net/dns", addr+" "+typ, 1024) } -// 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) { +func lookupHost(host string) (addrs []string, err error) { // Use /net/cs insead of /net/dns because cs knows about // host names in local network (e.g. from /lib/ndb/local) lines, err := queryCS("tcp", host, "1") @@ -95,9 +93,7 @@ func LookupHost(host string) (addrs []string, 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) (ips []IP, err error) { +func lookupIP(host string) (ips []IP, err error) { addrs, err := LookupHost(host) if err != nil { return @@ -110,8 +106,7 @@ func LookupIP(host string) (ips []IP, err error) { return } -// LookupPort looks up the port for the given network and service. -func LookupPort(network, service string) (port int, err error) { +func lookupPort(network, service string) (port int, err error) { switch network { case "tcp4", "tcp6": network = "tcp" @@ -140,11 +135,7 @@ func LookupPort(network, service string) (port int, err error) { return 0, unknownPortError } -// LookupCNAME returns the canonical DNS host for the given name. -// Callers that do not care about the canonical name can call -// LookupHost or LookupIP directly; both take care of resolving -// the canonical name as part of the lookup. -func LookupCNAME(name string) (cname string, err error) { +func lookupCNAME(name string) (cname string, err error) { lines, err := queryDNS(name, "cname") if err != nil { return @@ -157,16 +148,7 @@ func LookupCNAME(name string) (cname string, err error) { return "", errors.New("net: bad response from ndb/dns") } -// 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 sorted by priority and randomized -// by weight within a priority. -// -// LookupSRV constructs the DNS name to look up following RFC 2782. -// That is, it looks up _service._proto.name. To accommodate services -// publishing SRV records under non-standard names, if both service -// and proto are empty strings, LookupSRV looks up name directly. -func LookupSRV(service, proto, name string) (cname string, addrs []*SRV, err error) { +func lookupSRV(service, proto, name string) (cname string, addrs []*SRV, err error) { var target string if service == "" && proto == "" { target = name @@ -195,8 +177,7 @@ func LookupSRV(service, proto, name string) (cname string, addrs []*SRV, err err return } -// LookupMX returns the DNS MX records for the given domain name sorted by preference. -func LookupMX(name string) (mx []*MX, err error) { +func lookupMX(name string) (mx []*MX, err error) { lines, err := queryDNS(name, "mx") if err != nil { return @@ -214,8 +195,7 @@ func LookupMX(name string) (mx []*MX, err error) { return } -// LookupTXT returns the DNS TXT records for the given domain name. -func LookupTXT(name string) (txt []string, err error) { +func lookupTXT(name string) (txt []string, err error) { lines, err := queryDNS(name, "txt") if err != nil { return @@ -228,9 +208,7 @@ func LookupTXT(name string) (txt []string, err error) { return } -// LookupAddr performs a reverse lookup for the given address, returning a list -// of names mapping to that address. -func LookupAddr(addr string) (name []string, err error) { +func lookupAddr(addr string) (name []string, err error) { arpa, err := reverseaddr(addr) if err != nil { return diff --git a/src/pkg/net/lookup_unix.go b/src/pkg/net/lookup_unix.go index 5c475477b8..d500a1240d 100644 --- a/src/pkg/net/lookup_unix.go +++ b/src/pkg/net/lookup_unix.go @@ -52,9 +52,7 @@ func lookupProtocol(name string) (proto int, err error) { return } -// 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) { +func lookupHost(host string) (addrs []string, err error) { addrs, err, ok := cgoLookupHost(host) if !ok { addrs, err = goLookupHost(host) @@ -62,9 +60,7 @@ func LookupHost(host string) (addrs []string, 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) { +func lookupIP(host string) (addrs []IP, err error) { addrs, err, ok := cgoLookupIP(host) if !ok { addrs, err = goLookupIP(host) @@ -72,8 +68,7 @@ func LookupIP(host string) (addrs []IP, err error) { return } -// LookupPort looks up the port for the given network and service. -func LookupPort(network, service string) (port int, err error) { +func lookupPort(network, service string) (port int, err error) { port, err, ok := cgoLookupPort(network, service) if !ok { port, err = goLookupPort(network, service) @@ -81,11 +76,7 @@ func LookupPort(network, service string) (port int, err error) { return } -// LookupCNAME returns the canonical DNS host for the given name. -// Callers that do not care about the canonical name can call -// LookupHost or LookupIP directly; both take care of resolving -// the canonical name as part of the lookup. -func LookupCNAME(name string) (cname string, err error) { +func lookupCNAME(name string) (cname string, err error) { cname, err, ok := cgoLookupCNAME(name) if !ok { cname, err = goLookupCNAME(name) @@ -93,16 +84,7 @@ func LookupCNAME(name string) (cname string, err error) { return } -// 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 sorted by priority and randomized -// by weight within a priority. -// -// LookupSRV constructs the DNS name to look up following RFC 2782. -// That is, it looks up _service._proto.name. To accommodate services -// publishing SRV records under non-standard names, if both service -// and proto are empty strings, LookupSRV looks up name directly. -func LookupSRV(service, proto, name string) (cname string, addrs []*SRV, err error) { +func lookupSRV(service, proto, name string) (cname string, addrs []*SRV, err error) { var target string if service == "" && proto == "" { target = name @@ -123,8 +105,7 @@ func LookupSRV(service, proto, name string) (cname string, addrs []*SRV, err err return } -// LookupMX returns the DNS MX records for the given domain name sorted by preference. -func LookupMX(name string) (mx []*MX, err error) { +func lookupMX(name string) (mx []*MX, err error) { _, records, err := lookup(name, dnsTypeMX) if err != nil { return @@ -138,8 +119,7 @@ func LookupMX(name string) (mx []*MX, err error) { return } -// LookupTXT returns the DNS TXT records for the given domain name. -func LookupTXT(name string) (txt []string, err error) { +func lookupTXT(name string) (txt []string, err error) { _, records, err := lookup(name, dnsTypeTXT) if err != nil { return @@ -151,9 +131,7 @@ func LookupTXT(name string) (txt []string, err error) { return } -// LookupAddr performs a reverse lookup for the given address, returning a list -// of names mapping to that address. -func LookupAddr(addr string) (name []string, err error) { +func lookupAddr(addr string) (name []string, err error) { name = lookupStaticAddr(addr) if len(name) > 0 { return diff --git a/src/pkg/net/lookup_windows.go b/src/pkg/net/lookup_windows.go index 51afbd4bb8..dfe2ff6f1f 100644 --- a/src/pkg/net/lookup_windows.go +++ b/src/pkg/net/lookup_windows.go @@ -28,7 +28,7 @@ func lookupProtocol(name string) (proto int, err error) { return int(p.Proto), nil } -func LookupHost(name string) (addrs []string, err error) { +func lookupHost(name string) (addrs []string, err error) { ips, err := LookupIP(name) if err != nil { return @@ -40,7 +40,7 @@ func LookupHost(name string) (addrs []string, err error) { return } -func LookupIP(name string) (addrs []IP, err error) { +func lookupIP(name string) (addrs []IP, err error) { hostentLock.Lock() defer hostentLock.Unlock() h, e := syscall.GetHostByName(name) @@ -61,7 +61,7 @@ func LookupIP(name string) (addrs []IP, err error) { return addrs, nil } -func LookupPort(network, service string) (port int, err error) { +func lookupPort(network, service string) (port int, err error) { switch network { case "tcp4", "tcp6": network = "tcp" @@ -77,7 +77,7 @@ func LookupPort(network, service string) (port int, err error) { return int(syscall.Ntohs(s.Port)), nil } -func LookupCNAME(name string) (cname string, err error) { +func lookupCNAME(name string) (cname string, err error) { var r *syscall.DNSRecord e := syscall.DnsQuery(name, syscall.DNS_TYPE_CNAME, 0, nil, &r, nil) if e != nil { @@ -91,16 +91,7 @@ func LookupCNAME(name string) (cname string, err error) { return } -// 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 sorted by priority and randomized -// by weight within a priority. -// -// LookupSRV constructs the DNS name to look up following RFC 2782. -// That is, it looks up _service._proto.name. To accommodate services -// publishing SRV records under non-standard names, if both service -// and proto are empty strings, LookupSRV looks up name directly. -func LookupSRV(service, proto, name string) (cname string, addrs []*SRV, err error) { +func lookupSRV(service, proto, name string) (cname string, addrs []*SRV, err error) { var target string if service == "" && proto == "" { target = name @@ -122,7 +113,7 @@ func LookupSRV(service, proto, name string) (cname string, addrs []*SRV, err err return name, addrs, nil } -func LookupMX(name string) (mx []*MX, err error) { +func lookupMX(name string) (mx []*MX, err error) { var r *syscall.DNSRecord e := syscall.DnsQuery(name, syscall.DNS_TYPE_MX, 0, nil, &r, nil) if e != nil { @@ -138,7 +129,7 @@ func LookupMX(name string) (mx []*MX, err error) { return mx, nil } -func LookupTXT(name string) (txt []string, err error) { +func lookupTXT(name string) (txt []string, err error) { var r *syscall.DNSRecord e := syscall.DnsQuery(name, syscall.DNS_TYPE_TEXT, 0, nil, &r, nil) if e != nil { @@ -156,7 +147,7 @@ func LookupTXT(name string) (txt []string, err error) { return } -func LookupAddr(addr string) (name []string, err error) { +func lookupAddr(addr string) (name []string, err error) { arpa, err := reverseaddr(addr) if err != nil { return nil, err diff --git a/src/pkg/os/Makefile b/src/pkg/os/Makefile index f875c09a11..9f8d527ba3 100644 --- a/src/pkg/os/Makefile +++ b/src/pkg/os/Makefile @@ -6,6 +6,7 @@ include ../../Make.inc TARG=os GOFILES=\ + doc.go\ error.go\ env.go\ exec.go\ diff --git a/src/pkg/os/dir_plan9.go b/src/pkg/os/dir_plan9.go index 78228205f4..f2dc15409d 100644 --- a/src/pkg/os/dir_plan9.go +++ b/src/pkg/os/dir_plan9.go @@ -10,22 +10,7 @@ import ( "syscall" ) -// Readdir reads the contents of the directory associated with file and -// returns an array of up to n FileInfo structures, as would be returned -// by Lstat, in directory order. Subsequent calls on the same file will yield -// further FileInfos. -// -// If n > 0, Readdir returns at most n FileInfo structures. In this case, if -// Readdirnames returns an empty slice, it will return a non-nil error -// explaining why. At the end of a directory, the error is io.EOF. -// -// If n <= 0, Readdir returns all the FileInfo from the directory in -// a single slice. In this case, if Readdir succeeds (reads all -// the way to the end of the directory), it returns the slice and a -// nil error. If it encounters an error before the end of the -// directory, Readdir returns the FileInfo read until that point -// and a non-nil error. -func (file *File) Readdir(n int) (fi []FileInfo, err error) { +func (file *File) readdir(n int) (fi []FileInfo, err error) { // If this file has no dirinfo, create one. if file.dirinfo == nil { file.dirinfo = new(dirInfo) @@ -76,19 +61,7 @@ func (file *File) Readdir(n int) (fi []FileInfo, err error) { return result, nil } -// Readdirnames reads and returns a slice of names from the directory f. -// -// If n > 0, Readdirnames returns at most n names. In this case, if -// Readdirnames returns an empty slice, it will return a non-nil error -// explaining why. At the end of a directory, the error is io.EOF. -// -// If n <= 0, Readdirnames returns all the names from the directory in -// a single slice. In this case, if Readdirnames succeeds (reads all -// the way to the end of the directory), it returns the slice and a -// nil error. If it encounters an error before the end of the -// directory, Readdirnames returns the names read until that point and -// a non-nil error. -func (file *File) Readdirnames(n int) (names []string, err error) { +func (file *File) readdirnames(n int) (names []string, err error) { fi, err := file.Readdir(n) names = make([]string, len(fi)) for i := range fi { diff --git a/src/pkg/os/dir_unix.go b/src/pkg/os/dir_unix.go index e7a29554c1..f41f939a97 100644 --- a/src/pkg/os/dir_unix.go +++ b/src/pkg/os/dir_unix.go @@ -15,19 +15,7 @@ const ( blockSize = 4096 ) -// Readdirnames reads and returns a slice of names from the directory f. -// -// If n > 0, Readdirnames returns at most n names. In this case, if -// Readdirnames returns an empty slice, it will return a non-nil error -// explaining why. At the end of a directory, the error is io.EOF. -// -// If n <= 0, Readdirnames returns all the names from the directory in -// a single slice. In this case, if Readdirnames succeeds (reads all -// the way to the end of the directory), it returns the slice and a -// nil error. If it encounters an error before the end of the -// directory, Readdirnames returns the names read until that point and -// a non-nil error. -func (f *File) Readdirnames(n int) (names []string, err error) { +func (f *File) readdirnames(n int) (names []string, err error) { // If this file has no dirinfo, create one. if f.dirinfo == nil { f.dirinfo = new(dirInfo) diff --git a/src/pkg/os/dir_windows.go b/src/pkg/os/dir_windows.go index 6f999c0b0d..931316048b 100644 --- a/src/pkg/os/dir_windows.go +++ b/src/pkg/os/dir_windows.go @@ -4,7 +4,7 @@ package os -func (file *File) Readdirnames(n int) (names []string, err error) { +func (file *File) readdirnames(n int) (names []string, err error) { fis, err := file.Readdir(n) names = make([]string, len(fis)) for i, fi := range fis { diff --git a/src/pkg/os/doc.go b/src/pkg/os/doc.go new file mode 100644 index 0000000000..ef857c0429 --- /dev/null +++ b/src/pkg/os/doc.go @@ -0,0 +1,52 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package os + +// FindProcess looks for a running process by its pid. +// The Process it returns can be used to obtain information +// about the underlying operating system process. +func FindProcess(pid int) (p *Process, err error) { + return findProcess(pid) +} + +// Hostname returns the host name reported by the kernel. +func Hostname() (name string, err error) { + return hostname() +} + +// Readdir reads the contents of the directory associated with file and +// returns an array of up to n FileInfo values, as would be returned +// by Lstat, in directory order. Subsequent calls on the same file will yield +// further FileInfos. +// +// If n > 0, Readdir returns at most n FileInfo structures. In this case, if +// Readdir returns an empty slice, it will return a non-nil error +// explaining why. At the end of a directory, the error is io.EOF. +// +// If n <= 0, Readdir returns all the FileInfo from the directory in +// a single slice. In this case, if Readdir succeeds (reads all +// the way to the end of the directory), it returns the slice and a +// nil error. If it encounters an error before the end of the +// directory, Readdir returns the FileInfo read until that point +// and a non-nil error. +func (f *File) Readdir(n int) (fi []FileInfo, err error) { + return f.readdir(n) +} + +// Readdirnames reads and returns a slice of names from the directory f. +// +// If n > 0, Readdirnames returns at most n names. In this case, if +// Readdirnames returns an empty slice, it will return a non-nil error +// explaining why. At the end of a directory, the error is io.EOF. +// +// If n <= 0, Readdirnames returns all the names from the directory in +// a single slice. In this case, if Readdirnames succeeds (reads all +// the way to the end of the directory), it returns the slice and a +// nil error. If it encounters an error before the end of the +// directory, Readdirnames returns the names read until that point and +// a non-nil error. +func (f *File) Readdirnames(n int) (names []string, err error) { + return f.readdirnames(n) +} diff --git a/src/pkg/os/exec/lp_windows.go b/src/pkg/os/exec/lp_windows.go index d09e839a39..b7efcd68b8 100644 --- a/src/pkg/os/exec/lp_windows.go +++ b/src/pkg/os/exec/lp_windows.go @@ -42,6 +42,11 @@ func findExecutable(file string, exts []string) (string, error) { return ``, os.ENOENT } +// LookPath searches for an executable binary named file +// in the directories named by the PATH environment variable. +// If file contains a slash, it is tried directly and the PATH is not consulted. +// LookPath also uses PATHEXT environment variable to match +// a suitable candidate. func LookPath(file string) (f string, err error) { x := os.Getenv(`PATHEXT`) if x == `` { diff --git a/src/pkg/os/exec_plan9.go b/src/pkg/os/exec_plan9.go index 9a0db6dd3e..879d4d2a73 100644 --- a/src/pkg/os/exec_plan9.go +++ b/src/pkg/os/exec_plan9.go @@ -138,10 +138,7 @@ func (p *Process) Release() error { return nil } -// FindProcess looks for a running process by its pid. -// The Process it returns can be used to obtain information -// about the underlying operating system process. -func FindProcess(pid int) (p *Process, err error) { +func findProcess(pid int) (p *Process, err error) { // NOOP for Plan 9. return newProcess(pid, 0), nil } diff --git a/src/pkg/os/exec_unix.go b/src/pkg/os/exec_unix.go index 375813895d..6c11b63c34 100644 --- a/src/pkg/os/exec_unix.go +++ b/src/pkg/os/exec_unix.go @@ -72,10 +72,7 @@ func (p *Process) Release() error { return nil } -// FindProcess looks for a running process by its pid. -// The Process it returns can be used to obtain information -// about the underlying operating system process. -func FindProcess(pid int) (p *Process, err error) { +func findProcess(pid int) (p *Process, err error) { // NOOP for unix. return newProcess(pid, 0), nil } diff --git a/src/pkg/os/exec_windows.go b/src/pkg/os/exec_windows.go index c4c9dcfe82..7eb7d194d6 100644 --- a/src/pkg/os/exec_windows.go +++ b/src/pkg/os/exec_windows.go @@ -11,6 +11,8 @@ import ( "unsafe" ) +// Wait waits for the Process to exit or stop, and then returns a +// Waitmsg describing its status and an error, if any. func (p *Process) Wait(options int) (w *Waitmsg, err error) { s, e := syscall.WaitForSingleObject(syscall.Handle(p.handle), syscall.INFINITE) switch s { @@ -43,6 +45,7 @@ func (p *Process) Signal(sig Signal) error { return syscall.Errno(syscall.EWINDOWS) } +// Release releases any resources associated with the Process. func (p *Process) Release() error { if p.handle == -1 { return EINVAL @@ -57,7 +60,7 @@ func (p *Process) Release() error { return nil } -func FindProcess(pid int) (p *Process, err error) { +func findProcess(pid int) (p *Process, err error) { const da = syscall.STANDARD_RIGHTS_READ | syscall.PROCESS_QUERY_INFORMATION | syscall.SYNCHRONIZE h, e := syscall.OpenProcess(da, false, uint32(pid)) diff --git a/src/pkg/os/file_unix.go b/src/pkg/os/file_unix.go index 9e5d0add83..01b72358f2 100644 --- a/src/pkg/os/file_unix.go +++ b/src/pkg/os/file_unix.go @@ -139,22 +139,7 @@ func Lstat(name string) (fi FileInfo, err error) { return fileInfoFromStat(&stat, name), nil } -// Readdir reads the contents of the directory associated with file and -// returns an array of up to n FileInfo values, as would be returned -// by Lstat, in directory order. Subsequent calls on the same file will yield -// further FileInfos. -// -// If n > 0, Readdir returns at most n FileInfo structures. In this case, if -// Readdir returns an empty slice, it will return a non-nil error -// explaining why. At the end of a directory, the error is io.EOF. -// -// If n <= 0, Readdir returns all the FileInfo from the directory in -// a single slice. In this case, if Readdir succeeds (reads all -// the way to the end of the directory), it returns the slice and a -// nil error. If it encounters an error before the end of the -// directory, Readdir returns the FileInfo read until that point -// and a non-nil error. -func (f *File) Readdir(n int) (fi []FileInfo, err error) { +func (f *File) readdir(n int) (fi []FileInfo, err error) { dirname := f.name if dirname == "" { dirname = "." diff --git a/src/pkg/os/file_windows.go b/src/pkg/os/file_windows.go index 92f03c4241..f5aaca06e5 100644 --- a/src/pkg/os/file_windows.go +++ b/src/pkg/os/file_windows.go @@ -135,22 +135,7 @@ func (file *file) close() error { return err } -// Readdir reads the contents of the directory associated with file and -// returns an array of up to n FileInfo structures, as would be returned -// by Lstat, in directory order. Subsequent calls on the same file will yield -// further FileInfos. -// -// If n > 0, Readdir returns at most n FileInfo structures. In this case, if -// Readdir returns an empty slice, it will return a non-nil error -// explaining why. At the end of a directory, the error is io.EOF. -// -// If n <= 0, Readdir returns all the FileInfo from the directory in -// a single slice. In this case, if Readdir succeeds (reads all -// the way to the end of the directory), it returns the slice and a -// nil error. If it encounters an error before the end of the -// directory, Readdir returns the FileInfo read until that point -// and a non-nil error. -func (file *File) Readdir(n int) (fi []FileInfo, err error) { +func (file *File) readdir(n int) (fi []FileInfo, err error) { if file == nil || file.fd < 0 { return nil, EINVAL } diff --git a/src/pkg/os/sys_bsd.go b/src/pkg/os/sys_bsd.go index d196469e7d..0f263f1c12 100644 --- a/src/pkg/os/sys_bsd.go +++ b/src/pkg/os/sys_bsd.go @@ -11,7 +11,7 @@ package os import "syscall" -func Hostname() (name string, err error) { +func hostname() (name string, err error) { name, err = syscall.Sysctl("kern.hostname") if err != nil { return "", NewSyscallError("sysctl kern.hostname", err) diff --git a/src/pkg/os/sys_linux.go b/src/pkg/os/sys_linux.go index d322a63c2d..76cdf50432 100644 --- a/src/pkg/os/sys_linux.go +++ b/src/pkg/os/sys_linux.go @@ -6,8 +6,7 @@ package os -// Hostname returns the host name reported by the kernel. -func Hostname() (name string, err error) { +func hostname() (name string, err error) { f, err := Open("/proc/sys/kernel/hostname") if err != nil { return "", err diff --git a/src/pkg/os/sys_plan9.go b/src/pkg/os/sys_plan9.go index 8ad89fbc73..07a7905f47 100644 --- a/src/pkg/os/sys_plan9.go +++ b/src/pkg/os/sys_plan9.go @@ -6,7 +6,7 @@ package os -func Hostname() (name string, err error) { +func hostname() (name string, err error) { f, err := Open("#c/sysname") if err != nil { return "", err diff --git a/src/pkg/os/sys_windows.go b/src/pkg/os/sys_windows.go index 368086db20..92617de5e7 100644 --- a/src/pkg/os/sys_windows.go +++ b/src/pkg/os/sys_windows.go @@ -6,7 +6,7 @@ package os import "syscall" -func Hostname() (name string, err error) { +func hostname() (name string, err error) { s, e := syscall.ComputerName() if e != nil { return "", NewSyscallError("ComputerName", e) -- 2.50.0