// This file holds stub versions of the cgo functions called on Unix systems.
// We build this file if using the netgo build tag, or if cgo is not
-// enabled and we are using a Unix system other than Darwin.
+// enabled and we are using a Unix system other than Darwin, or if it's
+// wasip1 where cgo is never available.
// Darwin is exempted because it always provides the cgo routines,
// in cgo_unix_syscall.go.
-//go:build netgo || (!cgo && unix && !darwin)
+//go:build netgo || (!cgo && unix && !darwin) || wasip1
package net
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build !js && !wasip1
+//go:build !js
package net
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build !js && !wasip1
+//go:build !js
// DNS client: see RFC 1035.
// Has to be linked into package net for Dial.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build !js && !wasip1 && !windows
+//go:build !js && !windows
// Read system DNS config from /etc/resolv.conf
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build (js && wasm) || wasip1
+//go:build js && wasm
package net
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build unix
+//go:build unix || wasip1
package net
"sync"
"syscall"
"time"
-
- "golang.org/x/net/dns/dnsmessage"
)
var listenersMu sync.Mutex
func (fd *fakeNetFD) dup() (f *os.File, err error) {
return nil, syscall.ENOSYS
}
-
-func (r *Resolver) lookup(ctx context.Context, name string, qtype dnsmessage.Type, conf *dnsConfig) (dnsmessage.Parser, string, error) {
- panic("unreachable")
-}
package net
-import "internal/poll"
+import (
+ "context"
+ "internal/poll"
+
+ "golang.org/x/net/dns/dnsmessage"
+)
// Network file descriptor.
type netFD struct {
pfd poll.FD
isConnected bool // handshake completed or use of association with peer
}
+
+func (r *Resolver) lookup(ctx context.Context, name string, qtype dnsmessage.Type, conf *dnsConfig) (dnsmessage.Parser, string, error) {
+ panic("unreachable")
+}