summaryrefslogtreecommitdiff
path: root/libgo/go/strconv/atoi.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/strconv/atoi.go')
-rw-r--r--libgo/go/strconv/atoi.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/libgo/go/strconv/atoi.go b/libgo/go/strconv/atoi.go
index a236de421c6..66df149172d 100644
--- a/libgo/go/strconv/atoi.go
+++ b/libgo/go/strconv/atoi.go
@@ -199,6 +199,10 @@ func ParseInt(s string, base int, bitSize int) (i int64, err error) {
// Atoi returns the result of ParseInt(s, 10, 0) converted to type int.
func Atoi(s string) (int, error) {
+ const fnAtoi = "Atoi"
i64, err := ParseInt(s, 10, 0)
+ if nerr, ok := err.(*NumError); ok {
+ nerr.Func = fnAtoi
+ }
return int(i64), err
}