Update golanci-lint

This commit is contained in:
9seconds
2021-04-09 14:35:04 +03:00
parent 81bca75c25
commit 585ebfeb50
32 changed files with 101 additions and 75 deletions
+2 -2
View File
@@ -25,7 +25,7 @@ func (r *rwcMock) Read(p []byte) (int, error) {
return 0, io.EOF
}
return r.Buffer.Read(p)
return r.Buffer.Read(p) // nolint: wrapcheck
}
func (r *rwcMock) Write(p []byte) (int, error) {
@@ -36,7 +36,7 @@ func (r *rwcMock) Write(p []byte) (int, error) {
return 0, io.EOF
}
return r.Buffer.Write(p)
return r.Buffer.Write(p) // nolint: wrapcheck
}
func (r *rwcMock) Close() error {
+5 -1
View File
@@ -18,7 +18,11 @@ var relayPool = sync.Pool{
func AcquireRelay(ctx context.Context, logger Logger, bufferSize int, idleTimeout time.Duration) *Relay {
ctx, cancel := context.WithCancel(ctx)
r := relayPool.Get().(*Relay)
r, ok := relayPool.Get().(*Relay)
if !ok {
panic("Relay pool has no relay!")
}
r.ctx = ctx
r.ctxCancel = cancel
r.logger = logger