commit | fc6b74ce39748efc360afea4164c92a710ad6e77 | [log] [tgz] |
---|---|---|
author | Martin Möhrmann <moehrmann@google.com> | Sat Aug 12 20:11:55 2017 +0200 |
committer | Martin Möhrmann <moehrmann@google.com> | Sun Aug 13 09:11:32 2017 +0000 |
tree | 55f060933969f3a05a0fc07df7d1f797100c4470 | |
parent | 1d81251599fd1b8f9da888e10c1054c96d1e1fb1 [diff] |
strconv: fix ParseUint return value on range overflow If the value corresponding to the input string cannot be represented by an unsigned integer of the given size, err.Err = ErrRange and the returned value is the maximum magnitude unsigned integer of the appropriate bitSize. This is consistent with ParseInt's behavior and the documentation. Expand tests to test 32 bit test value tables with bitsize 32 set. These tests fail without the fix in this CL. Fixes #21278 Change-Id: I8aab39279ec3e31905fcbf582a916cbf6d9b95da Reviewed-on: https://go-review.googlesource.com/55134 Run-TryBot: Martin Möhrmann <moehrmann@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.
Go is the work of hundreds of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project does not use GitHub pull requests, and that we use the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.