mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-02 00:11:56 +03:00
Formatting by gofumpt
This commit is contained in:
@@ -129,7 +129,7 @@ func (a *Access) getIP(ntw mtglib.Network, protocol string) net.IP {
|
|||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
io.Copy(io.Discard, resp.Body) //nolint: errcheck
|
io.Copy(io.Discard, resp.Body) //nolint: errcheck
|
||||||
resp.Body.Close() //nolint: errcheck
|
resp.Body.Close() //nolint: errcheck
|
||||||
}()
|
}()
|
||||||
|
|
||||||
data, err := io.ReadAll(resp.Body)
|
data, err := io.ReadAll(resp.Body)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ func (h httpFile) Open(ctx context.Context) (io.ReadCloser, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
if response != nil {
|
if response != nil {
|
||||||
io.Copy(io.Discard, response.Body) //nolint: errcheck
|
io.Copy(io.Discard, response.Body) //nolint: errcheck
|
||||||
response.Body.Close() //nolint: errcheck
|
response.Body.Close() //nolint: errcheck
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, fmt.Errorf("cannot get url %s: %w", h.url, err)
|
return nil, fmt.Errorf("cannot get url %s: %w", h.url, err)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
func Relay(ctx context.Context, log Logger, telegramConn, clientConn essentials.Conn) {
|
func Relay(ctx context.Context, log Logger, telegramConn, clientConn essentials.Conn) {
|
||||||
defer telegramConn.Close() //nolint: errcheck
|
defer telegramConn.Close() //nolint: errcheck
|
||||||
defer clientConn.Close() //nolint: errcheck
|
defer clientConn.Close() //nolint: errcheck
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(ctx)
|
ctx, cancel := context.WithCancel(ctx)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
@@ -18,7 +18,7 @@ func Relay(ctx context.Context, log Logger, telegramConn, clientConn essentials.
|
|||||||
go func() {
|
go func() {
|
||||||
<-ctx.Done()
|
<-ctx.Done()
|
||||||
telegramConn.Close() //nolint: errcheck
|
telegramConn.Close() //nolint: errcheck
|
||||||
clientConn.Close() //nolint: errcheck
|
clientConn.Close() //nolint: errcheck
|
||||||
}()
|
}()
|
||||||
|
|
||||||
closeChan := make(chan struct{})
|
closeChan := make(chan struct{})
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ func (suite *StatsdTestSuite) SetupTest() {
|
|||||||
|
|
||||||
func (suite *StatsdTestSuite) TearDownTest() {
|
func (suite *StatsdTestSuite) TearDownTest() {
|
||||||
suite.statsd.Shutdown()
|
suite.statsd.Shutdown()
|
||||||
suite.factory.Close() //nolint: errcheck
|
suite.factory.Close() //nolint: errcheck
|
||||||
suite.statsdServer.Close() //nolint: errcheck
|
suite.statsdServer.Close() //nolint: errcheck
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user