pkg/environment: Remove 'net' related functions
This commit continues removing the environment abstraction and removes all 'net' related functions, replacing them by their native equivalents.
This commit is contained in:
parent
14bb7f1086
commit
39207a1cb5
7 changed files with 8 additions and 47 deletions
|
|
@ -1,10 +1,8 @@
|
|||
package environment
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"io/fs"
|
||||
"net"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
|
@ -38,9 +36,6 @@ type Environment interface {
|
|||
WalkDir(root string, fn fs.WalkDirFunc) error
|
||||
|
||||
Abs(path string) (string, error)
|
||||
|
||||
Listen(network, address string) (net.Listener, error)
|
||||
DialContext(context context.Context, network, address string) (net.Conn, error)
|
||||
}
|
||||
|
||||
type WritableFile interface {
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
package environment
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
)
|
||||
|
||||
func (*Native) Listen(network, address string) (net.Listener, error) {
|
||||
return net.Listen(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