chore: fmt.Errorf(...) instead of errors.New(fmt.Sprintf(...))

This commit is contained in:
guoguangwu 2023-07-14 21:53:23 +08:00
parent 4f12a4f308
commit 38cacb9e50

View File

@ -133,7 +133,7 @@ func (c *SSTCPConn) doRead(b []byte) (n int, err error) {
if !c.DecryptInited() { if !c.DecryptInited() {
if len(decodedData) < c.InfoIVLen() { if len(decodedData) < c.InfoIVLen() {
return 0, errors.New(fmt.Sprintf("invalid ivLen:%v, actual length:%v", c.InfoIVLen(), len(decodedData))) return 0, fmt.Errorf("invalid ivLen:%v, actual length:%v", c.InfoIVLen(), len(decodedData))
} }
iv := decodedData[0:c.InfoIVLen()] iv := decodedData[0:c.InfoIVLen()]