lint by golangci-lint (#3080)

This commit is contained in:
fatedier
2022-08-29 01:02:53 +08:00
committed by GitHub
parent f4e4fbea62
commit 9d077b02cf
122 changed files with 947 additions and 1331 deletions

View File

@@ -9,7 +9,10 @@ import (
func WriteBytes(w io.Writer, buf []byte) (int, error) {
out := bytes.NewBuffer(nil)
binary.Write(out, binary.BigEndian, int64(len(buf)))
if err := binary.Write(out, binary.BigEndian, int64(len(buf))); err != nil {
return 0, err
}
out.Write(buf)
return w.Write(out.Bytes())
}