Skip to content

Commit

Permalink
fix(core): recreate io.Reader after read during file loading (#4363)
Browse files Browse the repository at this point in the history
  • Loading branch information
Codelax authored Dec 17, 2024
1 parent 14a3c8c commit 870917b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/arg_file_content.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ func loadArgsFileContent(cmd *Command, cmdArgs interface{}) error {
}
test := bytes.NewBuffer(content)
v.Set(reflect.ValueOf(test))
} else {
// Reader must be re-created as it can only be read once.
r := bytes.NewReader(b)
v.Set(reflect.ValueOf(r))
}
case *string:
if strings.HasPrefix(*i, "@") {
Expand Down

0 comments on commit 870917b

Please sign in to comment.