mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-23 08:48:32 +02:00
small string split join optimization
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user