diff options
| author | jimmyfrasche <soapboxcicero@gmail.com> | 2018-04-01 11:15:17 -0700 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2018-04-01 20:17:22 +0000 |
| commit | 3c588b3fe7e1394f7df981284f1dc4c0a2b32b14 (patch) | |
| tree | 2b092e5a839d20b854f447ded0069d986b8253f2 /src/strings/replace.go | |
| parent | e55475ca3b6652d2d24b7bf48bcaf3e216c3ed68 (diff) | |
| download | go-3c588b3fe7e1394f7df981284f1dc4c0a2b32b14.tar.xz | |
flag: correct zero values when printing defaults
When the flag package first begin printing nonzero defaults, the test
was against a fixed set of string representations of zero values.
This worked until the string representation of a time.Duration
changed from "0" to "0s", causing the zero Duration to register as
nonzero. The flag package then added reflect-based code that fell back
to the old test. This failed to work when a nonzero default for a flag
happened to be the string representation of one the original fixed set
of zero values in the original test. This change removes the original
test, allowing the reflect-based code to be the only deciding factor.
Fixes #23543
Change-Id: I582ce554d6729e336fdd96fb27340674c15350d8
Reviewed-on: https://go-review.googlesource.com/103867
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/strings/replace.go')
0 files changed, 0 insertions, 0 deletions
