ci(lint): enable perfsprint linter (#4090)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
Matthieu MOREL
2024-11-15 16:51:12 +01:00
committed by GitHub
parent f875d87283
commit 02c1144f31
7 changed files with 31 additions and 22 deletions
+4 -4
View File
@@ -6,7 +6,7 @@ package binding
import (
"encoding/hex"
"fmt"
"errors"
"mime/multipart"
"reflect"
"strconv"
@@ -494,7 +494,7 @@ type customUnmarshalParamType struct {
func (f *customUnmarshalParamType) UnmarshalParam(param string) error {
parts := strings.Split(param, ":")
if len(parts) != 3 {
return fmt.Errorf("invalid format")
return errors.New("invalid format")
}
f.Protocol = parts[0]
f.Path = parts[1]
@@ -556,7 +556,7 @@ func (p *customPath) UnmarshalParam(param string) error {
elems := strings.Split(param, "/")
n := len(elems)
if n < 2 {
return fmt.Errorf("invalid format")
return errors.New("invalid format")
}
*p = elems
@@ -600,7 +600,7 @@ func (o *objectID) UnmarshalParam(param string) error {
func convertTo(s string) (objectID, error) {
var nilObjectID objectID
if len(s) != 24 {
return nilObjectID, fmt.Errorf("invalid format")
return nilObjectID, errors.New("invalid format")
}
var oid [12]byte