diff options
| author | Petter Rasmussen | 2016-01-18 21:35:08 +0100 | 
|---|---|---|
| committer | Petter Rasmussen | 2016-01-18 21:35:08 +0100 | 
| commit | 33716c2a43f92466401e08533308219fb520af9e (patch) | |
| tree | 60b64640ed9f42698c9791d756dfcc13b160b1d2 /drive/upload.go | |
| parent | d4d1b00c9609a4d493f79bdd74bae5dc60d37ed7 (diff) | |
| download | gdrive-33716c2a43f92466401e08533308219fb520af9e.tar.bz2 | |
Take output writer as argument
Diffstat (limited to 'drive/upload.go')
| -rw-r--r-- | drive/upload.go | 4 | 
1 files changed, 3 insertions, 1 deletions
| diff --git a/drive/upload.go b/drive/upload.go index 16ae940..3a65d0f 100644 --- a/drive/upload.go +++ b/drive/upload.go @@ -4,12 +4,14 @@ import (      "fmt"      "mime"      "os" +    "io"      "path/filepath"      "google.golang.org/api/drive/v3"      "golang.org/x/net/context"  )  type UploadFileArgs struct { +    Out io.Writer      Path string      Name string      Parent string @@ -61,7 +63,7 @@ func (self *Drive) Upload(args UploadFileArgs) (err error) {          return fmt.Errorf("Failed to upload file: %s", err)      } -    fmt.Printf("Uploaded '%s' at %s, total %d\n", f.Name, "x/s", f.Size) +    fmt.Fprintf(args.Out, "Uploaded '%s' at %s, total %d\n", f.Name, "x/s", f.Size)      //if args.Share {      //    self.Share(TODO)      //} | 
