From d949871b676ed52669c17c2070dfb770b6ce28da Mon Sep 17 00:00:00 2001 From: Alex Flint Date: Sat, 29 Oct 2022 15:13:57 -0400 Subject: [PATCH] add further comment about backwards-compatible method for setting default values --- parse.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/parse.go b/parse.go index cf364f3..2fb7b1c 100644 --- a/parse.go +++ b/parse.go @@ -210,6 +210,8 @@ func NewParser(config Config, dests ...interface{}) (*Parser, error) { } // for backwards compatibility, add nonzero field values as defaults + // this applies only to the top-level command, not to subcommands (this inconsistency + // is the reason that this method for setting default values was deprecated) for _, spec := range cmd.specs { // get the value v := p.val(spec.dest)