2011-03-28 21:28:42 -06:00
|
|
|
// Copyright 2011 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.
|
|
|
|
|
2012-01-23 13:16:38 -07:00
|
|
|
// +build !cgo
|
build: add build comments to core packages
The go/build package already recognizes
system-specific file names like
mycode_darwin.go
mycode_darwin_386.go
mycode_386.s
However, it is also common to write files that
apply to multiple architectures, so a recent CL added
to go/build the ability to process comments
listing a set of conditions for building. For example:
// +build darwin freebsd openbsd/386
says that this file should be compiled only on
OS X, FreeBSD, or 32-bit x86 OpenBSD systems.
These conventions are not yet documented
(hence this long CL description).
This CL adds build comments to the multi-system
files in the core library, a step toward making it
possible to use go/build to build them.
With this change go/build can handle crypto/rand,
exec, net, path/filepath, os/user, and time.
os and syscall need additional adjustments.
R=golang-dev, r, gri, r, gustavo
CC=golang-dev
https://golang.org/cl/5011046
2011-09-15 14:48:57 -06:00
|
|
|
|
2011-03-28 21:28:42 -06:00
|
|
|
// Stub cgo routines for systems that do not use cgo to do network lookups.
|
|
|
|
|
|
|
|
package net
|
|
|
|
|
2011-11-01 20:05:34 -06:00
|
|
|
func cgoLookupHost(name string) (addrs []string, err error, completed bool) {
|
2011-03-28 21:28:42 -06:00
|
|
|
return nil, nil, false
|
|
|
|
}
|
|
|
|
|
2011-11-01 20:05:34 -06:00
|
|
|
func cgoLookupPort(network, service string) (port int, err error, completed bool) {
|
2011-03-28 21:28:42 -06:00
|
|
|
return 0, nil, false
|
|
|
|
}
|
|
|
|
|
2011-11-01 20:05:34 -06:00
|
|
|
func cgoLookupIP(name string) (addrs []IP, err error, completed bool) {
|
2011-03-28 21:28:42 -06:00
|
|
|
return nil, nil, false
|
|
|
|
}
|
2011-04-20 13:21:59 -06:00
|
|
|
|
2011-11-01 20:05:34 -06:00
|
|
|
func cgoLookupCNAME(name string) (cname string, err error, completed bool) {
|
2011-04-20 13:21:59 -06:00
|
|
|
return "", nil, false
|
|
|
|
}
|