small string split join optimization

This commit is contained in:
yusing
2024-12-19 00:54:31 +08:00
parent 654194b274
commit e7be27413c
20 changed files with 160 additions and 50 deletions

View File

@@ -1,17 +1,7 @@
package strutils
import (
"errors"
"strconv"
E "github.com/yusing/go-proxy/internal/error"
)
func Atoi(s string) (int, E.Error) {
val, err := strconv.Atoi(s)
if err != nil {
return val, E.From(errors.Unwrap(err)).Subject(s)
}
return val, nil
}
var Atoi = strconv.Atoi