github.com/code-reading/golang@v0.0.0-20220303082512-ba5bc0e589a3/go/src/net/cgo_stub.go (about) 1 // Copyright 2011 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 //go:build !cgo || netgo 6 // +build !cgo netgo 7 8 package net 9 10 import "context" 11 12 func init() { netGo = true } 13 14 type addrinfoErrno int 15 16 func (eai addrinfoErrno) Error() string { return "<nil>" } 17 func (eai addrinfoErrno) Temporary() bool { return false } 18 func (eai addrinfoErrno) Timeout() bool { return false } 19 20 func cgoLookupHost(ctx context.Context, name string) (addrs []string, err error, completed bool) { 21 return nil, nil, false 22 } 23 24 func cgoLookupPort(ctx context.Context, network, service string) (port int, err error, completed bool) { 25 return 0, nil, false 26 } 27 28 func cgoLookupIP(ctx context.Context, network, name string) (addrs []IPAddr, err error, completed bool) { 29 return nil, nil, false 30 } 31 32 func cgoLookupCNAME(ctx context.Context, name string) (cname string, err error, completed bool) { 33 return "", nil, false 34 } 35 36 func cgoLookupPTR(ctx context.Context, addr string) (ptrs []string, err error, completed bool) { 37 return nil, nil, false 38 }