mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 12:54:01 +03:00
Update golanci-lint
This commit is contained in:
@@ -102,7 +102,7 @@ func (c *Access) Execute(cli *CLI) error {
|
||||
|
||||
func (c *Access) getIP(protocol string) net.IP {
|
||||
client := c.Network.MakeHTTPClient(func(ctx context.Context, network, address string) (net.Conn, error) {
|
||||
return c.Network.DialContext(ctx, protocol, address)
|
||||
return c.Network.DialContext(ctx, protocol, address) // nolint: wrapcheck
|
||||
})
|
||||
|
||||
req, err := http.NewRequest(http.MethodGet, "https://ifconfig.co", nil) // nolint: noctx
|
||||
|
||||
@@ -62,14 +62,14 @@ func (b *base) makeNetwork(conf *config.Config, version string) (mtglib.Network,
|
||||
|
||||
switch len(proxyURLs) {
|
||||
case 0:
|
||||
return network.NewNetwork(baseDialer, userAgent, dohIP, httpTimeout)
|
||||
return network.NewNetwork(baseDialer, userAgent, dohIP, httpTimeout) // nolint: wrapcheck
|
||||
case 1:
|
||||
socksDialer, err := network.NewSocks5Dialer(baseDialer, proxyURLs[0])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot build socks5 dialer: %w", err)
|
||||
}
|
||||
|
||||
return network.NewNetwork(socksDialer, userAgent, dohIP, httpTimeout)
|
||||
return network.NewNetwork(socksDialer, userAgent, dohIP, httpTimeout) // nolint: wrapcheck
|
||||
}
|
||||
|
||||
socksDialer, err := network.NewLoadBalancedSocks5Dialer(baseDialer, proxyURLs)
|
||||
@@ -77,5 +77,5 @@ func (b *base) makeNetwork(conf *config.Config, version string) (mtglib.Network,
|
||||
return nil, fmt.Errorf("cannot build socks5 dialer: %w", err)
|
||||
}
|
||||
|
||||
return network.NewNetwork(socksDialer, userAgent, dohIP, httpTimeout)
|
||||
return network.NewNetwork(socksDialer, userAgent, dohIP, httpTimeout) // nolint: wrapcheck
|
||||
}
|
||||
|
||||
@@ -15,13 +15,13 @@ type MtglibNetworkMock struct {
|
||||
func (m *MtglibNetworkMock) Dial(network, address string) (net.Conn, error) {
|
||||
args := m.Called(network, address)
|
||||
|
||||
return args.Get(0).(net.Conn), args.Error(1)
|
||||
return args.Get(0).(net.Conn), args.Error(1) // nolint: wrapcheck
|
||||
}
|
||||
|
||||
func (m *MtglibNetworkMock) DialContext(ctx context.Context, network, address string) (net.Conn, error) {
|
||||
args := m.Called(ctx, network, address)
|
||||
|
||||
return args.Get(0).(net.Conn), args.Error(1)
|
||||
return args.Get(0).(net.Conn), args.Error(1) // nolint: wrapcheck
|
||||
}
|
||||
|
||||
func (m *MtglibNetworkMock) MakeHTTPClient(dialFunc func(ctx context.Context,
|
||||
|
||||
@@ -24,7 +24,7 @@ func (n *NetConnMock) Write(b []byte) (int, error) {
|
||||
}
|
||||
|
||||
func (n *NetConnMock) Close() error {
|
||||
return n.Called().Error(0)
|
||||
return n.Called().Error(0) // nolint: wrapcheck
|
||||
}
|
||||
|
||||
func (n *NetConnMock) LocalAddr() net.Addr {
|
||||
@@ -36,13 +36,13 @@ func (n *NetConnMock) RemoteAddr() net.Addr {
|
||||
}
|
||||
|
||||
func (n *NetConnMock) SetDeadline(t time.Time) error {
|
||||
return n.Called(t).Error(0)
|
||||
return n.Called(t).Error(0) // nolint: wrapcheck
|
||||
}
|
||||
|
||||
func (n *NetConnMock) SetReadDeadline(t time.Time) error {
|
||||
return n.Called(t).Error(0)
|
||||
return n.Called(t).Error(0) // nolint: wrapcheck
|
||||
}
|
||||
|
||||
func (n *NetConnMock) SetWriteDeadline(t time.Time) error {
|
||||
return n.Called(t).Error(0)
|
||||
return n.Called(t).Error(0) // nolint: wrapcheck
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user