refactor: replace gperr with standard errors package and simplify string parsing

- Replace gperr.Error return types with standard error across test files
- Replace gperr.New with errors.New in validation and serialization tests
- Update API documentation in README files to use error instead of gperr.Error
- Simplify string parsing using strings.Cut in docker/label.go
- Update benchmarks to use NewTestEntrypoint and remove task package dependency
This commit is contained in:
yusing
2026-02-10 16:59:19 +08:00
parent a0d0ad0958
commit 1579f490c0
11 changed files with 45 additions and 69 deletions

View File

@@ -1,25 +1,24 @@
package serialization
import (
"errors"
"reflect"
"testing"
gperr "github.com/yusing/goutils/errs"
)
type CustomValidatingPointerStruct struct {
Value string
}
func (c *CustomValidatingPointerStruct) Validate() gperr.Error {
func (c *CustomValidatingPointerStruct) Validate() error {
if c == nil {
return gperr.New("pointer struct cannot be nil")
return errors.New("pointer struct cannot be nil")
}
if c.Value == "" {
return gperr.New("value cannot be empty")
return errors.New("value cannot be empty")
}
if len(c.Value) < 3 {
return gperr.New("value must be at least 3 characters")
return errors.New("value must be at least 3 characters")
}
return nil
}