Skip to content

Commit

Permalink
Fix file reader
Browse files Browse the repository at this point in the history
  • Loading branch information
maetthu committed Feb 20, 2021
1 parent 4efc01f commit 01ba22c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ var uploadCmd = &cobra.Command{
if args[0] == "-" {
upload = os.Stdin
} else {
upload, err := os.Open(args[0])
defer func() { _ = upload.Close() }()
f, err := os.Open(args[0])
defer func() { _ = f.Close() }()

if err != nil {
return err
}

upload = f
}

ctx := context.Background()
Expand Down

0 comments on commit 01ba22c

Please sign in to comment.