diff options
| author | Hu Jun <[email protected]> | 2025-05-10 16:26:11 -0700 |
|---|---|---|
| committer | Hu Jun <[email protected]> | 2025-05-10 16:26:11 -0700 |
| commit | 011db0c1163722ac2fa4452be8be8123768dc912 (patch) | |
| tree | 2e5527611783628aca69318fcf67523824047475 /text.go | |
| parent | 2a2b77a54936c042e155dd11eaacf2159b4b6cdf (diff) | |
- update text_test.go based on PR review comments
- return is missing in one error path of GetText(), fixed
Diffstat (limited to 'text.go')
| -rw-r--r-- | text.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -55,7 +55,7 @@ func (f *FlagSet) GetText(name string, out encoding.TextUnmarshaler) error { return fmt.Errorf("flag accessed but not defined: %s", name) } if flag.Value.Type() != reflect.TypeOf(out).Name() { - fmt.Errorf("trying to get %s value of flag of type %s", reflect.TypeOf(out).Name(), flag.Value.Type()) + return fmt.Errorf("trying to get %s value of flag of type %s", reflect.TypeOf(out).Name(), flag.Value.Type()) } return out.UnmarshalText([]byte(flag.Value.String())) } |
