go fmt files authenticate.go, acceptance/00-authentication.go and acceptance/libargs.go
diff --git a/acceptance/00-authentication.go b/acceptance/00-authentication.go
index 10ed022..2374efb 100644
--- a/acceptance/00-authentication.go
+++ b/acceptance/00-authentication.go
@@ -1,28 +1,28 @@
package main
import (
- "github.com/rackspace/gophercloud"
- "strings"
- "fmt"
- "os"
+ "fmt"
+ "github.com/rackspace/gophercloud"
+ "os"
+ "strings"
)
func main() {
- provider, username, _, apiKey := getCredentials()
+ provider, username, _, apiKey := getCredentials()
- if !strings.Contains(provider, "rackspace") {
- fmt.Fprintf(os.Stdout, "Skipping test because provider doesn't support API_KEYs\n")
- return
- }
+ if !strings.Contains(provider, "rackspace") {
+ fmt.Fprintf(os.Stdout, "Skipping test because provider doesn't support API_KEYs\n")
+ return
+ }
- _, err := gophercloud.Authenticate(
- provider,
- gophercloud.AuthOptions{
- Username: username,
- ApiKey: apiKey,
- },
- )
- if err != nil {
- panic(err)
- }
+ _, err := gophercloud.Authenticate(
+ provider,
+ gophercloud.AuthOptions{
+ Username: username,
+ ApiKey: apiKey,
+ },
+ )
+ if err != nil {
+ panic(err)
+ }
}
diff --git a/acceptance/libargs.go b/acceptance/libargs.go
index bc34d86..78fde06 100644
--- a/acceptance/libargs.go
+++ b/acceptance/libargs.go
@@ -15,7 +15,7 @@
provider = os.Getenv("SDK_PROVIDER")
username = os.Getenv("SDK_USERNAME")
password = os.Getenv("SDK_PASSWORD")
- apiKey = os.Getenv("SDK_API_KEY")
+ apiKey = os.Getenv("SDK_API_KEY")
if (provider == "") || (username == "") || (password == "") {
fmt.Fprintf(os.Stderr, "One or more of the following environment variables aren't set:\n")
diff --git a/authenticate.go b/authenticate.go
index 3597244..0f7c633 100644
--- a/authenticate.go
+++ b/authenticate.go
@@ -42,8 +42,8 @@
type Auth struct {
PasswordCredentials *PasswordCredentials `json:"passwordCredentials,omitempty"`
ApiKeyCredentials *ApiKeyCredentials `json:"RAX-KSKEY:apiKeyCredentials,omitempty"`
- TenantId string `json:"tenantId,omitempty"`
- TenantName string `json:"tenantName,omitempty"`
+ TenantId string `json:"tenantId,omitempty"`
+ TenantName string `json:"tenantName,omitempty"`
}
// PasswordCredentials provides a JSON encoding wrapper for passing credentials to the Identity
@@ -53,10 +53,9 @@
Password string `json:"password"`
}
-
type ApiKeyCredentials struct {
Username string `json:"username"`
- ApiKey string `json:"apiKey"`
+ ApiKey string `json:"apiKey"`
}
// Access encapsulates the API token and its relevant fields, as well as the
@@ -109,10 +108,9 @@
VersionId, VersionInfo, VersionList string
}
-
//
func getAuthCredentials(options AuthOptions) Auth {
- if (options.ApiKey == "") {
+ if options.ApiKey == "" {
return Auth{
PasswordCredentials: &PasswordCredentials{
Username: options.Username,
@@ -120,16 +118,16 @@
},
TenantId: options.TenantId,
TenantName: options.TenantName,
- };
+ }
} else {
return Auth{
ApiKeyCredentials: &ApiKeyCredentials{
Username: options.Username,
- ApiKey: options.ApiKey,
+ ApiKey: options.ApiKey,
},
TenantId: options.TenantId,
TenantName: options.TenantName,
- };
+ }
}
}