diff --git a/cmd/upload.go b/cmd/upload.go index 96ab6bc..281c15f 100644 --- a/cmd/upload.go +++ b/cmd/upload.go @@ -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()