chore(internal): linter complaints

This commit is contained in:
Jakob Borg
2025-06-06 13:45:44 +02:00
parent ef6d561c66
commit e25de22705
4 changed files with 8 additions and 4 deletions
+4 -2
View File
@@ -7,14 +7,16 @@
package protoutil
import (
"fmt"
"errors"
"google.golang.org/protobuf/proto"
)
var errBufferTooSmall = errors.New("buffer too small")
func MarshalTo(buf []byte, pb proto.Message) (int, error) {
if sz := proto.Size(pb); len(buf) < sz {
return 0, fmt.Errorf("buffer too small")
return 0, errBufferTooSmall
} else if sz == 0 {
return 0, nil
}