Commit 8050782c authored by Ian Lance Taylor's avatar Ian Lance Taylor

flag: improve comment for calling String with zero value

Update #16694.

Change-Id: Id6be1535d8a146b3dac3bee429ce407a51272032
Reviewed-on: https://go-review.googlesource.com/27634
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarRob Pike <r@golang.org>
parent 78fac02c
...@@ -238,7 +238,8 @@ func (d *durationValue) String() string { return (*time.Duration)(d).String() } ...@@ -238,7 +238,8 @@ func (d *durationValue) String() string { return (*time.Duration)(d).String() }
// rather than using the next command-line argument. // rather than using the next command-line argument.
// //
// Set is called once, in command line order, for each flag present. // Set is called once, in command line order, for each flag present.
// String must work on the zero value of the dynamic type. // The flag package may call the String method with a zero-valued receiver,
// such as a nil pointer.
type Value interface { type Value interface {
String() string String() string
Set(string) error Set(string) error
......
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