mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-01 16:01:55 +03:00
Update golanci-lint
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user