Fix golint warnings

This commit is contained in:
Nick Craig-Wood 2016-10-03 20:40:54 +01:00
parent c43395fafa
commit 03977354cb

View file

@ -135,8 +135,8 @@ type Fs struct {
bucket string // the bucket we are working on bucket string // the bucket we are working on
root string // the path we are working on if any root string // the path we are working on if any
projectNumber string // used for finding buckets projectNumber string // used for finding buckets
objectAcl string // used when creating new objects objectACL string // used when creating new objects
bucketAcl string // used when creating new buckets bucketACL string // used when creating new buckets
} }
// Object describes a storage object // Object describes a storage object
@ -231,14 +231,14 @@ func NewFs(name, root string) (fs.Fs, error) {
bucket: bucket, bucket: bucket,
root: directory, root: directory,
projectNumber: fs.ConfigFile.MustValue(name, "project_number"), projectNumber: fs.ConfigFile.MustValue(name, "project_number"),
objectAcl: fs.ConfigFile.MustValue(name, "object_acl"), objectACL: fs.ConfigFile.MustValue(name, "object_acl"),
bucketAcl: fs.ConfigFile.MustValue(name, "bucket_acl"), bucketACL: fs.ConfigFile.MustValue(name, "bucket_acl"),
} }
if f.objectAcl == "" { if f.objectACL == "" {
f.objectAcl = "private" f.objectACL = "private"
} }
if f.bucketAcl == "" { if f.bucketACL == "" {
f.bucketAcl = "private" f.bucketACL = "private"
} }
// Create a new authorized Drive client. // Create a new authorized Drive client.
@ -462,7 +462,7 @@ func (f *Fs) Mkdir() error {
bucket := storage.Bucket{ bucket := storage.Bucket{
Name: f.bucket, Name: f.bucket,
} }
_, err = f.svc.Buckets.Insert(f.projectNumber, &bucket).PredefinedAcl(f.bucketAcl).Do() _, err = f.svc.Buckets.Insert(f.projectNumber, &bucket).PredefinedAcl(f.bucketACL).Do()
return err return err
} }
@ -682,7 +682,7 @@ func (o *Object) Update(in io.Reader, src fs.ObjectInfo) error {
Updated: modTime.Format(timeFormatOut), // Doesn't get set Updated: modTime.Format(timeFormatOut), // Doesn't get set
Metadata: metadataFromModTime(modTime), Metadata: metadataFromModTime(modTime),
} }
newObject, err := o.fs.svc.Objects.Insert(o.fs.bucket, &object).Media(in, googleapi.ContentType("")).Name(object.Name).PredefinedAcl(o.fs.objectAcl).Do() newObject, err := o.fs.svc.Objects.Insert(o.fs.bucket, &object).Media(in, googleapi.ContentType("")).Name(object.Name).PredefinedAcl(o.fs.objectACL).Do()
if err != nil { if err != nil {
return err return err
} }