Use environment DialContext and Listen everywhere
This commit is contained in:
parent
f19619ef9f
commit
b0d3c686ba
11 changed files with 64 additions and 30 deletions
|
|
@ -1,11 +1,15 @@
|
|||
package environment
|
||||
|
||||
import "net"
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
)
|
||||
|
||||
func (Native) Listen(network, address string) (net.Listener, error) {
|
||||
return net.Listen(network, address)
|
||||
}
|
||||
|
||||
func (Native) Dial(network, address string) (net.Conn, error) {
|
||||
return net.Dial(network, address)
|
||||
func (Native) DialContext(context context.Context, network, address string) (net.Conn, error) {
|
||||
var d net.Dialer
|
||||
return d.DialContext(context, network, address)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue