From 8d5d332dafc421c68f66e6041c31554495b99997 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 11 Jan 2019 16:57:05 +0000 Subject: [PATCH] build: fix problems found with golint --- backend/cache/cache_internal_test.go | 12 +++++------- backend/swift/swift.go | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/backend/cache/cache_internal_test.go b/backend/cache/cache_internal_test.go index 3f0a69f63..266d89df1 100644 --- a/backend/cache/cache_internal_test.go +++ b/backend/cache/cache_internal_test.go @@ -1632,15 +1632,13 @@ func (r *run) getCacheFs(f fs.Fs) (*cache.Fs, error) { cfs, ok := f.(*cache.Fs) if ok { return cfs, nil - } else { - if f.Features().UnWrap != nil { - cfs, ok := f.Features().UnWrap().(*cache.Fs) - if ok { - return cfs, nil - } + } + if f.Features().UnWrap != nil { + cfs, ok := f.Features().UnWrap().(*cache.Fs) + if ok { + return cfs, nil } } - return nil, errors.New("didn't found a cache fs") } diff --git a/backend/swift/swift.go b/backend/swift/swift.go index 54267c1cd..f56cb690d 100644 --- a/backend/swift/swift.go +++ b/backend/swift/swift.go @@ -195,7 +195,7 @@ type Options struct { StorageURL string `config:"storage_url"` AuthToken string `config:"auth_token"` AuthVersion int `config:"auth_version"` - ApplicationCredentialId string `config:"application_credential_id"` + ApplicationCredentialID string `config:"application_credential_id"` ApplicationCredentialName string `config:"application_credential_name"` ApplicationCredentialSecret string `config:"application_credential_secret"` StoragePolicy string `config:"storage_policy"` @@ -317,7 +317,7 @@ func swiftConnection(opt *Options, name string) (*swift.Connection, error) { StorageUrl: opt.StorageURL, AuthToken: opt.AuthToken, AuthVersion: opt.AuthVersion, - ApplicationCredentialId: opt.ApplicationCredentialId, + ApplicationCredentialId: opt.ApplicationCredentialID, ApplicationCredentialName: opt.ApplicationCredentialName, ApplicationCredentialSecret: opt.ApplicationCredentialSecret, EndpointType: swift.EndpointType(opt.EndpointType),