Skip to content

Commit 3764a03

Browse files
committed
PR feedback
1 parent 1e609f1 commit 3764a03

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ and [stealthrocket/wasi-go](https://github.com/stealthrocket/wasi-go).
99
## Dialing
1010

1111
The library will automatically configure the default HTTP transport
12-
to use the `Dial` function from this library
12+
to use the `Dial` function from this library.
1313

1414
To make outbound HTTP connections you just need the following import somewhere:
1515

lookup_wasip1.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,5 @@ func lookupAddr(context, network, address string) (net.Addr, error) {
6161
return &net.UDPAddr{IP: ip, Port: port}, nil
6262
}
6363
}
64-
return nil, fmt.Errorf("lookup failed: %q", address)
64+
return nil, &net.DNSError{Err: "lookup failed", Name: hostname, IsNotFound: true}
6565
}

lookup_wasip1_purego.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,5 @@ func lookupAddr(context, network, address string) (net.Addr, error) {
7171
}
7272
}
7373
}
74-
return nil, fmt.Errorf("lookup failed: %q", address)
74+
return nil, &net.DNSError{Err: "lookup failed", Name: hostname, IsNotFound: true}
7575
}

syscall/net_wasip1.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,30 +117,39 @@ type RawSockaddrAny struct {
117117
}
118118

119119
//go:wasmimport wasi_snapshot_preview1 sock_open
120+
//go:noescape
120121
func sock_open(af int32, socktype int32, fd unsafe.Pointer) Errno
121122

122123
//go:wasmimport wasi_snapshot_preview1 sock_bind
124+
//go:noescape
123125
func sock_bind(fd int32, addr unsafe.Pointer, port uint32) Errno
124126

125127
//go:wasmimport wasi_snapshot_preview1 sock_listen
128+
//go:noescape
126129
func sock_listen(fd int32, backlog int32) Errno
127130

128131
//go:wasmimport wasi_snapshot_preview1 sock_connect
132+
//go:noescape
129133
func sock_connect(fd int32, addr unsafe.Pointer, port uint32) Errno
130134

131135
//go:wasmimport wasi_snapshot_preview1 sock_getsockopt
136+
//go:noescape
132137
func sock_getsockopt(fd int32, level uint32, name uint32, value unsafe.Pointer, valueLen uint32) Errno
133138

134139
//go:wasmimport wasi_snapshot_preview1 sock_setsockopt
140+
//go:noescape
135141
func sock_setsockopt(fd int32, level uint32, name uint32, value unsafe.Pointer, valueLen uint32) Errno
136142

137143
//go:wasmimport wasi_snapshot_preview1 sock_getlocaladdr
144+
//go:noescape
138145
func sock_getlocaladdr(fd int32, addr unsafe.Pointer, port unsafe.Pointer) Errno
139146

140147
//go:wasmimport wasi_snapshot_preview1 sock_getpeeraddr
148+
//go:noescape
141149
func sock_getpeeraddr(fd int32, addr unsafe.Pointer, port unsafe.Pointer) Errno
142150

143151
//go:wasmimport wasi_snapshot_preview1 sock_getaddrinfo
152+
//go:noescape
144153
func sock_getaddrinfo(
145154
node unsafe.Pointer,
146155
nodeLen uint32,

0 commit comments

Comments
 (0)