- 29 Apr, 2019 13 commits
-
-
Elias Naur authored
When running Go programs on Corellium virtual iPhones, the Info.plist files might not exist. Ignore the error. Updates #31722 Change-Id: Id2e315c09346b69dda9e10cf29fb5dba6743aac4 Reviewed-on: https://go-review.googlesource.com/c/go/+/174202 Run-TryBot: Elias Naur <mail@eliasnaur.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Brad Fitzpatrick authored
Fixes #25210 Change-Id: If27b61776154dae9b9b67bf4e4f5faa785d98105 Reviewed-on: https://go-review.googlesource.com/c/go/+/174318Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Haosdent Huang authored
For example, can use `goroutine all bt` to dump all goroutines' information. Change-Id: I51b547c2b837913e4bdabf0f45b28f09250a3e34 GitHub-Last-Rev: d04dcd4f581f97e35ee45969a864f1270d79e49b GitHub-Pull-Request: golang/go#26283 Reviewed-on: https://go-review.googlesource.com/c/go/+/122589 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: David Chase <drchase@google.com>
-
Joel Sing authored
OpenBSD does not provide auxv, however we still need to initialise cpu.HWCap. For now initialise it to the bare minimum, until some form of CPU capability detection is implemented or becomes available - see issue #31746. Updates #31656 Change-Id: I68c3c069319fe60dc873f46def2a67c9f3d937d5 Reviewed-on: https://go-review.googlesource.com/c/go/+/174129 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Richard Musiol authored
Command line arguments containing multi-byte characters were causing go_js_wasm_exec to crash (RangeError: Source is too large), because their byte length was not handled correctly. This change fixes the bug. Fixes #31645. Change-Id: I7860ebf5b12da37d9d0f43d4b6a22d326a90edaf Reviewed-on: https://go-review.googlesource.com/c/go/+/173877 Run-TryBot: Richard Musiol <neelance@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
BigMikes authored
KeepAlive field used to report the wording "keep-alive period" which may be misleading. This field does not represent the whole TCP keepalive time, that is the inactivity period upon which one endpoint starts probing the other end. But it acctually specifies the keepalive interval, that is the time between two keepalive probes. Fixes #29089 Change-Id: If99b38ba108830d0e5fe527171a2f5c96a3bcde7 Reviewed-on: https://go-review.googlesource.com/c/go/+/155960Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Brad Fitzpatrick authored
Fix breakage from CL 173437 Change-Id: If218ffaa1259fbdee641143ffbe4b38030c373b9 Reviewed-on: https://go-review.googlesource.com/c/go/+/174278Reviewed-by: Michael Munday <mike.munday@ibm.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
Dmitri Shuralyov authored
The behavior of Value.String method on non-string JavaScript types has changed after CL 169757. Update the implementation of Transport.RoundTrip method to construct the Response.Status string without relying on result.Get("status").String(), since that now returns strings like "<number: 200>" instead of "200". Fixes #31736 Change-Id: I27b3e6cc95aa65fd1918b1400e88478a154aad12 Reviewed-on: https://go-review.googlesource.com/c/go/+/174218Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Richard Musiol <neelance@gmail.com>
-
Daniel Martí authored
I recently modified tabwriter to reduce the number of defers due to flush calls. However, I forgot to notice that the new function flushNoDefers can no longer return an error, due to the lack of the defer. In crypto/tls, hashForServerKeyExchange never returned a non-nil error, so simplify the code. Finally, in go/types and net we can find a few trivially unused parameters, so remove them. Change-Id: I54c8de83fbc944df432453b55c93008d7e810e61 Reviewed-on: https://go-review.googlesource.com/c/go/+/174131 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Benny Siegert <bsiegert@gmail.com>
-
Romain Baugue authored
Adds a sample Fuzz test function to package encoding/json following the guidelines defined in #31309, based on https://github.com/dvyukov/go-fuzz-corpus/blob/master/json/json.go Fixes #31309 Updates #19109 Change-Id: I5fe04d9a5f41c0de339f8518dae30896ec14e356 Reviewed-on: https://go-review.googlesource.com/c/go/+/174058Reviewed-by: Dmitry Vyukov <dvyukov@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Dmitry Vyukov <dvyukov@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Russ Cox authored
This CL adds support for consulting the Go checksum database when downloading a module that is not already listed in go.sum. The overall system is described at golang.org/design/25530-sumdb, and this CL implements the functionality described specifically in golang.org/design/25530-sumdb#command-client. Although the eventual plan is to set GOPROXY and GOSUMDB to default to a Google-run proxy serving the public Go ecosystem, this CL leaves them off by default. Fixes #30601. Change-Id: Ie46140f93c6cc2d85573fbce0878a258819ff44d Reviewed-on: https://go-review.googlesource.com/c/go/+/173951 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Alex Myasoedov authored
Updates #30990 Change-Id: I968fb13251ab3796328089046a3f0fc5c7eb9df9 Reviewed-on: https://go-review.googlesource.com/c/go/+/174204Reviewed-by: Benny Siegert <bsiegert@gmail.com> Run-TryBot: Benny Siegert <bsiegert@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Alessandro Arzilli authored
Whitelists functions debugCall32 through debugCall65536 in runtime.debugCallCheck so that any instruction inside those functions is considered a safe point. This is useful for implementing nested function calls. For example when evaluating: f(g(x)) The debugger should: 1. initiate the call to 'f' until the entry point of 'f', 2. complete the call to 'g(x)' 3. copy the return value of 'g(x)' in the arguments of 'f' 4. complete the call to 'f' Similarly for: f().amethod() The debugger should initiate the call to '.amethod()', then initiate and complete the call to f(), copy the return value to the arguments of '.amethod()' and finish its call. However in this example, unlike the other example, it may be impossible to determine the entry point of '.amethod()' until after 'f()' is evaluated, which means that the call to 'f()' needs to be initiated while stopped inside a debugCall... function. Change-Id: I575c23542709cedb1a171d63576f7e11069c7674 Reviewed-on: https://go-review.googlesource.com/c/go/+/161137 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com>
-
- 28 Apr, 2019 4 commits
-
-
Carlos Eduardo Seo authored
This change creates an intrinsic for Add64 for ppc64x and adds a testcase for it. name old time/op new time/op delta Add64-160 1.90ns ±40% 2.29ns ± 0% ~ (p=0.119 n=5+5) Add64multiple-160 6.69ns ± 2% 2.45ns ± 4% -63.47% (p=0.016 n=4+5) Change-Id: I9abe6fb023fdf62eea3c9b46a1820f60bb0a7f97 Reviewed-on: https://go-review.googlesource.com/c/go/+/173758Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> Run-TryBot: Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
-
Joel Sing authored
The kqueue system call takes no arguments, hence there should be no need to zero the registers used for the first syscall arguments. Change-Id: Ia79b2d4f4d568bb6795cb885e1464cf1fc2bf7c7 Reviewed-on: https://go-review.googlesource.com/c/go/+/174128 Run-TryBot: Benny Siegert <bsiegert@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Benny Siegert <bsiegert@gmail.com>
-
Jason A. Donenfeld authored
This allows creating processes that can only be debugged/accessed by certain tokens, according to a particular security descriptor. We already had everything ready for this but just neglected to pass through the value from the user-accessible SysProcAttr. Change-Id: I4a3fcc9f5078aa0058b26c103355c984093ae03f Reviewed-on: https://go-review.googlesource.com/c/go/+/174197 Run-TryBot: Jason Donenfeld <Jason@zx2c4.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
-
Alex Brainman authored
CL 172418 added code to check for "Access is denied" error. But "Access is denied" error will be spelled differently on non-English version of Windows. Check if error is ERROR_ACCESS_DENIED instead. Updates #31247 Change-Id: I7b1633013d563f7c06c1f12a9be75122106834f9 Reviewed-on: https://go-review.googlesource.com/c/go/+/174123Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
-
- 27 Apr, 2019 9 commits
-
-
Elias Naur authored
getfsstat64 is deprecated but not yet caught by the App Store checks. Use the supported getfsstat$INODE64 form instead to ensure forward compatibility. Change-Id: I0d97e8a8b254debb3de1cfcb3778dbed3702c249 Reviewed-on: https://go-review.googlesource.com/c/go/+/174200 Run-TryBot: Elias Naur <mail@eliasnaur.com> Reviewed-by: Keith Randall <khr@golang.org>
-
Elias Naur authored
Some libc functions are suffixed with "$INODE64" on macOS. Unfortunately, the iOS simulator doesn't have the suffixes, so we can't use GOARCH to distinguish the two platform. Add linker support for adding the suffix, using the macho platform to determine whether it is needed. While here, add the correct suffix for fdopendir on 386. It's "$INODE64$UNIX2003", believe it or not. Without the suffix, GOARCH=386 go test -short syscall crashes on my Mojave machine. Fixes #31447 Change-Id: I9bd3de40ece7df62f744bc24cd00909e56b00b78 Reviewed-on: https://go-review.googlesource.com/c/go/+/174199 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Elias Naur authored
Determine the macho platform once and use that the two places that need it. This makes it easier to add a third platform check for a follow-up change. Updates #31447 Change-Id: I522a5fface647ab8e608f816c5832d531534df7a Reviewed-on: https://go-review.googlesource.com/c/go/+/174198 Run-TryBot: Elias Naur <mail@eliasnaur.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Brian Kessler authored
"Division by invariant integers using multiplication" paper by Granlund and Montgomery contains a method for directly computing divisibility (x%c == 0 for c constant) by means of the modular inverse. The method is further elaborated in "Hacker's Delight" by Warren Section 10-17 This general rule can compute divisibilty by one multiplication and a compare for odd divisors and an additional rotate for even divisors. To apply the divisibility rule, we must take into account the rules to rewrite x%c = x-((x/c)*c) and (x/c) for c constant on the first optimization pass "opt". This complicates the matching as we want to match only in the cases where the result of (x/c) is not also available. So, we must match on the expanded form of (x/c) in the expression x == c*(x/c) in the "late opt" pass after common subexpresion elimination. Note, that if there is an intermediate opt pass introduced in the future we could simplify these rules by delaying the magic division rewrite to "late opt" and matching directly on (x/c) in the intermediate opt pass. Additional rules to lower the generic RotateLeft* ops were also applied. On amd64, the divisibility check is 25-50% faster. name old time/op new time/op delta DivconstI64-4 2.08ns ± 0% 2.08ns ± 1% ~ (p=0.881 n=5+5) DivisibleconstI64-4 2.67ns ± 0% 2.67ns ± 1% ~ (p=1.000 n=5+5) DivisibleWDivconstI64-4 2.67ns ± 0% 2.67ns ± 0% ~ (p=0.683 n=5+5) DivconstU64-4 2.08ns ± 1% 2.08ns ± 1% ~ (p=1.000 n=5+5) DivisibleconstU64-4 2.77ns ± 1% 1.55ns ± 2% -43.90% (p=0.008 n=5+5) DivisibleWDivconstU64-4 2.99ns ± 1% 2.99ns ± 1% ~ (p=1.000 n=5+5) DivconstI32-4 1.53ns ± 2% 1.53ns ± 0% ~ (p=1.000 n=5+5) DivisibleconstI32-4 2.23ns ± 0% 2.25ns ± 3% ~ (p=0.167 n=5+5) DivisibleWDivconstI32-4 2.27ns ± 1% 2.27ns ± 1% ~ (p=0.429 n=5+5) DivconstU32-4 1.78ns ± 0% 1.78ns ± 1% ~ (p=1.000 n=4+5) DivisibleconstU32-4 2.52ns ± 2% 1.26ns ± 0% -49.96% (p=0.000 n=5+4) DivisibleWDivconstU32-4 2.63ns ± 0% 2.85ns ±10% +8.29% (p=0.016 n=4+5) DivconstI16-4 1.54ns ± 0% 1.54ns ± 0% ~ (p=0.333 n=4+5) DivisibleconstI16-4 2.10ns ± 0% 2.10ns ± 1% ~ (p=0.571 n=4+5) DivisibleWDivconstI16-4 2.22ns ± 0% 2.23ns ± 1% ~ (p=0.556 n=4+5) DivconstU16-4 1.09ns ± 0% 1.01ns ± 1% -7.74% (p=0.000 n=4+5) DivisibleconstU16-4 1.83ns ± 0% 1.26ns ± 0% -31.52% (p=0.008 n=5+5) DivisibleWDivconstU16-4 1.88ns ± 0% 1.89ns ± 1% ~ (p=0.365 n=5+5) DivconstI8-4 1.54ns ± 1% 1.54ns ± 1% ~ (p=1.000 n=5+5) DivisibleconstI8-4 2.10ns ± 0% 2.11ns ± 0% ~ (p=0.238 n=5+4) DivisibleWDivconstI8-4 2.22ns ± 0% 2.23ns ± 2% ~ (p=0.762 n=5+5) DivconstU8-4 0.92ns ± 1% 0.94ns ± 1% +2.65% (p=0.008 n=5+5) DivisibleconstU8-4 1.66ns ± 0% 1.26ns ± 1% -24.28% (p=0.008 n=5+5) DivisibleWDivconstU8-4 1.79ns ± 0% 1.80ns ± 1% ~ (p=0.079 n=4+5) A follow-up change will address the signed division case. Updates #30282 Change-Id: I7e995f167179aa5c76bb10fbcbeb49c520943403 Reviewed-on: https://go-review.googlesource.com/c/go/+/168037 Run-TryBot: Brian Kessler <brian.m.kessler@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Joel Sing authored
Updates #31656 Change-Id: If481df050cd879f7c7c22a79c17c33af00a8b389 Reviewed-on: https://go-review.googlesource.com/c/go/+/174125 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Joel Sing authored
Updates #31656 Change-Id: Ie28734298bf1a2d5243f1ac15569311c1887176e Reviewed-on: https://go-review.googlesource.com/c/go/+/174126Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Joel Sing authored
The notdead argument to sys___threxit() is a pointer, hence requires a 64-bit move rather than a 32-bit one. Updates #31656 Change-Id: I52ad31ed5afaf43ccc3d934025288216e8052528 Reviewed-on: https://go-review.googlesource.com/c/go/+/174124Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Dmitri Goutnik authored
Preserve file modification times when copying bootstrap tree, this makes generated bootstrap more friendly to rsyncing. Change-Id: I32cde58c25b48d3c00d4413860dbd49a265b0ff2 Reviewed-on: https://go-review.googlesource.com/c/go/+/174217Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Mark Rushakoff authored
Change-Id: I38b22786aae3d7a08cf2863ef5d15e476fe30093 GitHub-Last-Rev: 57d07dd1c711029b965afd32e1d8a3c22560276f GitHub-Pull-Request: golang/go#31711 Reviewed-on: https://go-review.googlesource.com/c/go/+/174086Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
-
- 26 Apr, 2019 14 commits
-
-
Daniel Theophanes authored
It is common for database integers to be represented as int32 internally. Although NullInt64 is already defined, this should remove some type casts and make working with those eaiser. For #31231 Change-Id: Ia0c37ecef035fee0734c1d1fb6f58aef6905cf5e Reviewed-on: https://go-review.googlesource.com/c/go/+/174178 Run-TryBot: Daniel Theophanes <kardianos@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Cherry Zhang authored
For linking large binaries, the slice of Relocs consumes a large amount of memory. We can reduce this memory consumption by shrinking the size of the Reloc struct. This CL moves the fields used only in external linking or only on PPC64 and S390X to a lazily initialized side struct. Linking k8s.io/kubernetes/cmd/kube-apiserver on Linux/AMD64, before: inuse_space 1240.25MB total 438.11MB 35.32% 35.32% 438.11MB 35.32% cmd/link/internal/objfile.(*objReader).readSlices after: inuse_space 1123.39MB total 306.85MB 27.31% 55.03% 306.85MB 27.31% cmd/link/internal/objfile.(*objReader).readSlices Under GOGC=5 (to simulate system under memory pressure), the max RSS reduces from ~2.05G to ~1.83G. Even with external linking the max RSS doesn't increase. Change-Id: I9bb8a8effaed24a8b3c4b1cfb93e6992b8740f91 Reviewed-on: https://go-review.googlesource.com/c/go/+/173437 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Daniel Theophanes authored
A nil src (NULL database value) will result in a "nil" string, which will never parse correctly in a ParseInt or similar numeric conversion. The resulting error is confusing. Check for a nil src prior to converting the value to string if the resulting string will be parsed after that. Closes #31274 Change-Id: I90f12cceff00fbbfdd3e343b04fa7e2596390e6d Reviewed-on: https://go-review.googlesource.com/c/go/+/174177Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Marcel van Lohuizen authored
This updates the packages from text and net to use the Unicode 11 tables. Updates golang/go#27945 Change-Id: I096e80283f37b596f2aa8bd3e5ffec6b7045469a Reviewed-on: https://go-review.googlesource.com/c/go/+/174057 Run-TryBot: Marcel van Lohuizen <mpvl@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Russ Cox authored
Copied and updated import paths. Eventually we will probably publish these packages somewhere in golang.org/x (as non-internal packages) and then we will be able to vendor them properly. For now, copy. sumweb.globsMatchPath moved to str.GlobsMatchPath. Change-Id: I4585e6dc5daa423e4ca9669195d41e58e7c8c275 Reviewed-on: https://go-review.googlesource.com/c/go/+/173950Reviewed-by: Jay Conrod <jayconrod@google.com>
-
Russ Cox authored
Needed for Go checksum database integration in cmd/go. Generated with "go mod vendor" in client with that CL already applied. Change-Id: I1aa84977ba3a62504d3f4c069f48c07c67b83023 Reviewed-on: https://go-review.googlesource.com/c/go/+/173949Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
-
Joel Sing authored
Updates #31656 Change-Id: Iff0b2c2b2ca95f8c246436e35a22b70efb8e61d3 Reviewed-on: https://go-review.googlesource.com/c/go/+/174121Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Joel Sing authored
Generated on OpenBSD 6.5. Updates #31656 Change-Id: I0a7ddeee42d982ecbc226e82dec983c63e6c836d Reviewed-on: https://go-review.googlesource.com/c/go/+/174120Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Joel Sing authored
Updates #31656 Change-Id: I0b7486f7381fd8bd16a76278c0e9ec9763671fcc Reviewed-on: https://go-review.googlesource.com/c/go/+/174119 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Ian Lance Taylor authored
Testing whether cgo is enabled in go/build is not the same as testing whether the go tool supports cgo. They differ, for example, when using GOARCH=386 on an amd64 system, as for a cross-build cgo is disabled by default. Change-Id: Ib59106c92a3131b73ac6a91c0f7658a1769acf73 Reviewed-on: https://go-review.googlesource.com/c/go/+/174098 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Joel Sing authored
This brings in support for openbsd/arm64. Updated via 'go get' and 'go mod vendor'. Updates #31656 Change-Id: I18ffbc622d542f61ca0442b9dab28271fa2cfa85 Reviewed-on: https://go-review.googlesource.com/c/go/+/174118Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Brandon Ryan authored
Fixes #19686 Change-Id: I5c2dd60636b521425647afd0725fdd7c18e7bbbe GitHub-Last-Rev: a1c5f569409d8759d5d81da811eaf873073bfe39 GitHub-Pull-Request: golang/go#31682 Reviewed-on: https://go-review.googlesource.com/c/go/+/173997Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Clément Chigot authored
AIX doesn't allow to mmap an address range which is already mmap. Therefore, once the region has been allocated, it must munmap before being able to play with it. Change-Id: I1547782f0379024f57869f1dda8c1c9bb12d831f Reviewed-on: https://go-review.googlesource.com/c/go/+/174059Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
LE Manh Cuong authored
When the leading zero format is used, we currently don't handle the month and year properly. For the month, we were reporting an out of range error when getnum returns zero of its own, as it also returns the month 0. That's confusing, so only check the range when getnum returns a nil error. For the year, we don't restore the value when parsing error occurs. For example, with the incorrect input "111-01", "01" will be used to report an error. So restore the value when an error occurs fix the problem. Fixes #29918 Fixes #29916 Change-Id: I3145f8c46813a0457766b7c302482e6b56f94ed6 Reviewed-on: https://go-review.googlesource.com/c/go/+/160338 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-