Commit c0d45765 authored by Rob Pike's avatar Rob Pike

strconv: document value returned by ParseInt when there is an error

Documenting existing behavior; new commentary only.
Fixes #7105.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/68840044
parent 6ffd2351
...@@ -142,9 +142,11 @@ Error: ...@@ -142,9 +142,11 @@ Error:
// //
// The errors that ParseInt returns have concrete type *NumError // The errors that ParseInt returns have concrete type *NumError
// and include err.Num = s. If s is empty or contains invalid // and include err.Num = s. If s is empty or contains invalid
// digits, err.Err = ErrSyntax; if the value corresponding // digits, err.Err = ErrSyntax and the returned value is 0;
// to s cannot be represented by a signed integer of the // if the value corresponding to s cannot be represented by a
// given size, err.Err = ErrRange. // signed integer of the given size, err.Err = ErrRange and the
// returned value is the maximum magnitude integer of the
// appropriate bitSize and sign.
func ParseInt(s string, base int, bitSize int) (i int64, err error) { func ParseInt(s string, base int, bitSize int) (i int64, err error) {
const fnParseInt = "ParseInt" const fnParseInt = "ParseInt"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment