aboutsummaryrefslogtreecommitdiffstats
path: root/drive/about.go
diff options
context:
space:
mode:
authorPetter Rasmussen2016-01-17 23:12:26 +0100
committerPetter Rasmussen2016-01-17 23:12:26 +0100
commitd4d1b00c9609a4d493f79bdd74bae5dc60d37ed7 (patch)
treef54e38bf8654ce3deab9691acbfe3df6a5d438da /drive/about.go
parentc88aba0d9b14777be0915541503ca0e1a7936f67 (diff)
downloadgdrive-d4d1b00c9609a4d493f79bdd74bae5dc60d37ed7.tar.bz2
Return error
Diffstat (limited to 'drive/about.go')
-rw-r--r--drive/about.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/drive/about.go b/drive/about.go
index 0dbeca2..bea9fda 100644
--- a/drive/about.go
+++ b/drive/about.go
@@ -12,9 +12,11 @@ type AboutArgs struct {
ExportFormats bool
}
-func (self *Drive) About(args AboutArgs) {
+func (self *Drive) About(args AboutArgs) (err error) {
about, err := self.service.About.Get().Fields("exportFormats", "importFormats", "maxImportSizes", "maxUploadSize", "storageQuota", "user").Do()
- errorF(err, "Failed to get about %s", err)
+ if err != nil {
+ return fmt.Errorf("Failed to get about: %s", err)
+ }
if args.ExportFormats {
printSupportedFormats(about.ExportFormats)
@@ -34,6 +36,7 @@ func (self *Drive) About(args AboutArgs) {
fmt.Printf("Free: %s\n", formatSize(quota.Limit - quota.UsageInDrive, args.SizeInBytes))
fmt.Printf("Total: %s\n", formatSize(quota.Limit, args.SizeInBytes))
fmt.Printf("Max upload size: %s\n", formatSize(about.MaxUploadSize, args.SizeInBytes))
+ return
}
func printSupportedFormats(formats map[string][]string) {