diff options
| author | Grégoire Duchêne <gduchene@awhk.org> | 2022-12-03 21:30:28 +0000 |
|---|---|---|
| committer | Grégoire Duchêne <gduchene@awhk.org> | 2022-12-03 21:30:28 +0000 |
| commit | e2fb0e1ccaaedf5c4004db01593a0773cd626006 (patch) | |
| tree | bc384cab6a3efe3ea02e2d34841aca022c8a4926 | |
| parent | 6f81c7e746a3c7917f9d0efc1a6b34d905135866 (diff) | |
Remove MutableFlagValue
We can just have an ad hoc interface and not clutter the API.
| -rw-r--r-- | flag.go | 9 |
1 files changed, 1 insertions, 8 deletions
@@ -83,7 +83,7 @@ func InitFlagSet(fs *flag.FlagSet, env []string, cfg map[string]string, args []s } if f.DefValue != f.Value.String() { - if _, ok := f.Value.(MutableFlagValue); !ok { + if _, ok := f.Value.(interface{ MutableFlag() }); !ok { return } } @@ -108,13 +108,6 @@ func InitFlagSet(fs *flag.FlagSet, env []string, cfg map[string]string, args []s return err } -// MutableFlagValue is used to signal whether it is safe to set a flag -// to another value if it has already been set before, i.e. if its -// current value (as a string) is the same as its default value. -type MutableFlagValue interface { - MutableFlagValue() -} - // ParseString returns the string passed with no error set. func ParseString(s string) (string, error) { return s, nil |
