aboutsummaryrefslogtreecommitdiff
path: root/text.go
diff options
context:
space:
mode:
authorHu Jun <[email protected]>2025-05-10 16:26:11 -0700
committerHu Jun <[email protected]>2025-05-10 16:26:11 -0700
commit011db0c1163722ac2fa4452be8be8123768dc912 (patch)
tree2e5527611783628aca69318fcf67523824047475 /text.go
parent2a2b77a54936c042e155dd11eaacf2159b4b6cdf (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.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/text.go b/text.go
index 3726606..886d5a3 100644
--- a/text.go
+++ b/text.go
@@ -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()))
}