Skip to content

Commit 4da0ae6

Browse files
author
Fred
committed
bug fix
1 parent 6371c9c commit 4da0ae6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clap/args.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func fillStruct(args []string, fieldDescs map[string]*fieldDescription, cfg any)
124124
reflectValue := reflect.ValueOf(cfg).Elem()
125125
for name, desc := range fieldDescs {
126126
field := reflectValue.Field(desc.Field)
127-
if !field.CanSet() {
127+
if !field.CanSet() || len(desc.Args) == 0 {
128128
continue
129129
}
130130
switch desc.Type.Kind() {

0 commit comments

Comments
 (0)