diff --git a/util/pkg/vfs/swiftfs.go b/util/pkg/vfs/swiftfs.go index 6e0d6b8767..1282f2d1c7 100644 --- a/util/pkg/vfs/swiftfs.go +++ b/util/pkg/vfs/swiftfs.go @@ -96,7 +96,7 @@ func NewSwiftClient() (*gophercloud.ServiceClient, error) { type OpenstackConfig struct { } -func (_ OpenstackConfig) filename() (string, error) { +func (OpenstackConfig) filename() (string, error) { name := os.Getenv("OPENSTACK_CREDENTIAL_FILE") if name != "" { klog.V(2).Infof("using openstack config found in $OPENSTACK_CREDENTIAL_FILE: %s", name) @@ -137,7 +137,7 @@ func (oc OpenstackConfig) GetCredential() (gophercloud.AuthOptions, error) { // prioritize environment config env, enverr := openstack.AuthOptionsFromEnv() if enverr != nil { - klog.Warningf("Could not initialize swift from environment: %v", enverr) + klog.Warningf("Could not initialize OpenStack config from environment: %v", enverr) // fallback to config file return oc.getCredentialFromFile() } @@ -165,7 +165,7 @@ func (oc OpenstackConfig) GetRegion() (string, error) { // TODO: Unsure if this is the correct section for region values, err := oc.getSection("Global", items) if err != nil { - return "", fmt.Errorf("Region not provided in OS_REGION_NAME or openstack config section GLOBAL") + return "", fmt.Errorf("region not provided in OS_REGION_NAME or openstack config section GLOBAL") } return values["region"], nil } @@ -527,7 +527,7 @@ func (p *SwiftPath) Hash(a hashing.HashAlgorithm) (*hashing.Hash, error) { md5Bytes, err := hex.DecodeString(md5) if err != nil { - return nil, fmt.Errorf("Etag was not a valid MD5 sum: %q", md5) + return nil, fmt.Errorf("etag was not a valid MD5 sum: %q", md5) } return &hashing.Hash{Algorithm: hashing.HashAlgorithmMD5, HashValue: md5Bytes}, nil