mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 21:14:01 +03:00
Use CloseRead and CloseWrites
This commit is contained in:
@@ -2,9 +2,9 @@ package testlib
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
"net/http"
|
||||
|
||||
"github.com/9seconds/mtg/v2/essentials"
|
||||
"github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
@@ -12,19 +12,19 @@ type MtglibNetworkMock struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
func (m *MtglibNetworkMock) Dial(network, address string) (net.Conn, error) {
|
||||
func (m *MtglibNetworkMock) Dial(network, address string) (essentials.Conn, error) {
|
||||
args := m.Called(network, address)
|
||||
|
||||
return args.Get(0).(net.Conn), args.Error(1) // nolint: wrapcheck
|
||||
return args.Get(0).(essentials.Conn), args.Error(1) // nolint: wrapcheck
|
||||
}
|
||||
|
||||
func (m *MtglibNetworkMock) DialContext(ctx context.Context, network, address string) (net.Conn, error) {
|
||||
func (m *MtglibNetworkMock) DialContext(ctx context.Context, network, address string) (essentials.Conn, error) {
|
||||
args := m.Called(ctx, network, address)
|
||||
|
||||
return args.Get(0).(net.Conn), args.Error(1) // nolint: wrapcheck
|
||||
return args.Get(0).(essentials.Conn), args.Error(1) // nolint: wrapcheck
|
||||
}
|
||||
|
||||
func (m *MtglibNetworkMock) MakeHTTPClient(dialFunc func(ctx context.Context,
|
||||
network, address string) (net.Conn, error)) *http.Client {
|
||||
network, address string) (essentials.Conn, error)) *http.Client {
|
||||
return m.Called(dialFunc).Get(0).(*http.Client)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user