Skip to content

Commit 5498fa9

Browse files
committed
strconv: simplify the text for bases in ParseInt
Followon from a review comment in https://golang.org/cl/191078 Change-Id: If115b2ae0df5e5cb9babd60802947ddb687d56c2 Reviewed-on: https://go-review.googlesource.com/c/go/+/191219 Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 65e624e commit 5498fa9

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/strconv/atoi.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,10 @@ func ParseUint(s string, base int, bitSize int) (uint64, error) {
152152
// ParseInt interprets a string s in the given base (0, 2 to 36) and
153153
// bit size (0 to 64) and returns the corresponding value i.
154154
//
155-
// If base == 0, the base is implied by the string's prefix:
156-
// base 2 for "0b", base 8 for "0" or "0o", base 16 for "0x",
157-
// and base 10 otherwise. Also, for base == 0 only, underscore
158-
// characters are permitted per the Go integer literal syntax.
159-
// If base is below 0, is 1, or is above 36, an error is returned.
155+
// If the base argument is 0, the true base is implied by the string's
156+
// prefix: 2 for "0b", 8 for "0" or "0o", 16 for "0x", and 10 otherwise.
157+
// Also, for argument base 0 only, underscore characters are permitted
158+
// as defined by the Go syntax for integer literals.
160159
//
161160
// The bitSize argument specifies the integer type
162161
// that the result must fit into. Bit sizes 0, 8, 16, 32, and 64

0 commit comments

Comments
 (0)