Skip to content

Commit

Permalink
fix: parse arg even if args=0, we need create flag info into the flagset
Browse files Browse the repository at this point in the history
  • Loading branch information
hui.wang committed Jan 13, 2022
1 parent 1abf9af commit e98ea2c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xconf.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func (x *XConf) parse(valPtr interface{}) (err error) {

func (x *XConf) parseFlagFilesForXConf(flagSet *flag.FlagSet, args ...string) (flagData map[string]interface{}, filesToParse []string, err error) {
filesToParse = x.cc.Files
if x.cc.FlagSet == nil || len(x.cc.FlagArgs) == 0 {
if x.cc.FlagSet == nil {
return
}
if fv := x.cc.FlagSet.Lookup(MetaKeyFlagFiles); fv == nil {
Expand Down

0 comments on commit e98ea2c

Please sign in to comment.