all: Clean up fmt.Errorf usage (#8309)

This commit is contained in:
greatroar
2022-04-27 20:30:13 +02:00
committed by GitHub
parent 4031568cdf
commit 49488c0e71
4 changed files with 11 additions and 8 deletions
+2 -2
View File
@@ -45,7 +45,7 @@ func DeviceIDFromString(s string) (DeviceID, error) {
func DeviceIDFromBytes(bs []byte) (DeviceID, error) {
var n DeviceID
if len(bs) != len(n) {
return n, fmt.Errorf("incorrect length of byte slice representing device ID")
return n, errors.New("incorrect length of byte slice representing device ID")
}
copy(n[:], bs)
return n, nil
@@ -129,7 +129,7 @@ func (n *DeviceID) UnmarshalText(bs []byte) error {
}
}
func (n *DeviceID) ProtoSize() int {
func (*DeviceID) ProtoSize() int {
// Used by protobuf marshaller.
return DeviceIDLength
}