Code clean up

This commit is contained in:
NI
2022-04-15 18:42:16 +08:00
parent 0c3c4952fc
commit f884d7cf76
19 changed files with 46 additions and 66 deletions

View File

@@ -31,13 +31,13 @@ import (
// Errors
var (
ErrHandlerUnknownHeaderType = errors.New(
"Unknown command header type")
"unknown command header type")
ErrHandlerControlMessageTooLong = errors.New(
"Control message was too long")
"control message was too long")
ErrHandlerInvalidControlMessage = errors.New(
"Invalid control message")
"invalid control message")
)
// HandlerCancelSignal signals the cancel of the entire handling proccess
@@ -113,11 +113,6 @@ type streamHandlerSender struct {
sendDelay time.Duration
}
// signal sends handler signal
func (h streamHandlerSender) signal(hd Header, d []byte, buf []byte) error {
return h.handlerSender.signal(hd, d, buf)
}
// Write sends data
func (h streamHandlerSender) Write(b []byte) (int, error) {
defer time.Sleep(h.sendDelay)