go fmt reformatting
diff --git a/authenticate.go b/authenticate.go
index 07a5611..52bc1ab 100644
--- a/authenticate.go
+++ b/authenticate.go
@@ -51,9 +51,9 @@
Token Token
ServiceCatalog []CatalogEntry
User User
- provider Provider `json:"-"`
+ provider Provider `json:"-"`
options AuthOptions `json:"-"`
- context *Context `json:"-"`
+ context *Context `json:"-"`
}
// Token encapsulates an authentication token and when it expires. It also includes
diff --git a/flavors.go b/flavors.go
index 33c66d4..eb864d5 100644
--- a/flavors.go
+++ b/flavors.go
@@ -10,7 +10,7 @@
err := gsp.context.WithReauth(gsp.access, func() error {
url := gsp.endpoint + "/flavors/detail"
- return perigee.Get(url, perigee.Options{
+ return perigee.Get(url, perigee.Options{
CustomClient: gsp.context.httpClient,
Results: &struct{ Flavors *[]Flavor }{&fs},
MoreHeaders: map[string]string{
diff --git a/global_context.go b/global_context.go
index 9977aa8..5a3b162 100644
--- a/global_context.go
+++ b/global_context.go
@@ -59,4 +59,4 @@
return 0, ErrError
}
return err.Actual, nil
-}
\ No newline at end of file
+}
diff --git a/images.go b/images.go
index d0bd57e..38c73e1 100644
--- a/images.go
+++ b/images.go
@@ -74,4 +74,3 @@
Updated string `json:"updated"`
OsDcfDiskConfig string `json:"OS-DCF:diskConfig"`
}
-
diff --git a/interfaces.go b/interfaces.go
index d6c75b9..c8a6f96 100644
--- a/interfaces.go
+++ b/interfaces.go
@@ -129,4 +129,3 @@
// returns full details for each flavor, if available.
ListFlavors() ([]Flavor, error)
}
-
diff --git a/reauth.go b/reauth.go
index 5637ea2..eb9ac1e 100644
--- a/reauth.go
+++ b/reauth.go
@@ -20,4 +20,4 @@
}
}
return err
-}
\ No newline at end of file
+}
diff --git a/reauth_test.go b/reauth_test.go
index e6ccb17..e3501b8 100644
--- a/reauth_test.go
+++ b/reauth_test.go
@@ -1,8 +1,8 @@
package gophercloud
import (
- "testing"
"github.com/racker/perigee"
+ "testing"
)
// This reauth-handler does nothing, and returns no error.
@@ -18,7 +18,7 @@
calls++
return &perigee.UnexpectedResponseCodeError{
Expected: []int{204},
- Actual: 404,
+ Actual: 404,
}
})
@@ -44,7 +44,7 @@
calls++
return &perigee.UnexpectedResponseCodeError{
Expected: []int{204},
- Actual: 401,
+ Actual: 401,
}
})
@@ -67,7 +67,7 @@
c.WithReauth(nil, func() error {
return &perigee.UnexpectedResponseCodeError{
Expected: []int{204},
- Actual: 401,
+ Actual: 401,
}
})
@@ -77,7 +77,8 @@
}
}
-type MyError struct {}
+type MyError struct{}
+
func (*MyError) Error() string {
return "MyError instance"
}
@@ -90,7 +91,7 @@
err := c.WithReauth(nil, func() error {
return &perigee.UnexpectedResponseCodeError{
Expected: []int{204},
- Actual: 401,
+ Actual: 401,
}
})
@@ -100,7 +101,8 @@
}
}
-type MyAccess struct {}
+type MyAccess struct{}
+
func (my *MyAccess) FirstEndpointUrlByCriteria(ApiCriteria) string {
return ""
}
@@ -125,7 +127,7 @@
c.WithReauth(fakeAccess, func() error {
return &perigee.UnexpectedResponseCodeError{
Expected: []int{204},
- Actual: 401,
+ Actual: 401,
}
})
}
diff --git a/servers.go b/servers.go
index 16d82c5..e127e05 100644
--- a/servers.go
+++ b/servers.go
@@ -4,8 +4,8 @@
package gophercloud
import (
- "github.com/racker/perigee"
"fmt"
+ "github.com/racker/perigee"
)
// genericServersProvider structures provide the implementation for generic OpenStack-compatible
@@ -134,21 +134,21 @@
// See the CloudServersProvider interface for details.
func (gsp *genericServersProvider) ResizeServer(id, newName, newFlavor, newDiskConfig string) error {
err := gsp.context.WithReauth(gsp.access, func() error {
- url := fmt.Sprintf("%s/servers/%s/action", gsp.endpoint, id)
- rr := ResizeRequest{
- Name: newName,
- FlavorRef: newFlavor,
- DiskConfig: newDiskConfig,
- }
- return perigee.Post(url, perigee.Options{
- ReqBody: &struct {
- Resize ResizeRequest `json:"resize"`
- }{rr},
- OkCodes: []int{202},
- MoreHeaders: map[string]string{
- "X-Auth-Token": gsp.access.AuthToken(),
- },
- })
+ url := fmt.Sprintf("%s/servers/%s/action", gsp.endpoint, id)
+ rr := ResizeRequest{
+ Name: newName,
+ FlavorRef: newFlavor,
+ DiskConfig: newDiskConfig,
+ }
+ return perigee.Post(url, perigee.Options{
+ ReqBody: &struct {
+ Resize ResizeRequest `json:"resize"`
+ }{rr},
+ OkCodes: []int{202},
+ MoreHeaders: map[string]string{
+ "X-Auth-Token": gsp.access.AuthToken(),
+ },
+ })
})
return err
}
@@ -193,7 +193,7 @@
url := fmt.Sprintf("%s/servers/%s/action", gsp.endpoint, id)
types := map[bool]string{false: "SOFT", true: "HARD"}
return perigee.Post(url, perigee.Options{
- ReqBody: &struct{
+ ReqBody: &struct {
Reboot struct {
Type string `json:"type"`
} `json:"reboot"`
@@ -217,13 +217,13 @@
err := gsp.context.WithReauth(gsp.access, func() error {
url := fmt.Sprintf("%s/servers/%s/action", gsp.endpoint, id)
return perigee.Post(url, perigee.Options{
- ReqBody: &struct{
+ ReqBody: &struct {
Rescue string `json:"rescue"`
}{"none"},
MoreHeaders: map[string]string{
"X-Auth-Token": gsp.access.AuthToken(),
},
- Results: &struct{
+ Results: &struct {
AdminPass **string `json:"adminPass"`
}{&pw},
})
@@ -236,7 +236,7 @@
return gsp.context.WithReauth(gsp.access, func() error {
url := fmt.Sprintf("%s/servers/%s/action", gsp.endpoint, id)
return perigee.Post(url, perigee.Options{
- ReqBody: &struct{
+ ReqBody: &struct {
Unrescue *int `json:"unrescue"`
}{nil},
MoreHeaders: map[string]string{
@@ -253,13 +253,13 @@
err := gsp.context.WithReauth(gsp.access, func() error {
url := fmt.Sprintf("%s/servers/%s", gsp.endpoint, id)
return perigee.Put(url, perigee.Options{
- ReqBody: &struct{
+ ReqBody: &struct {
Server NewServerSettings `json:"server"`
}{changes},
MoreHeaders: map[string]string{
"X-Auth-Token": gsp.access.AuthToken(),
},
- Results: &struct{
+ Results: &struct {
Server **Server `json:"server"`
}{&svr},
})
@@ -395,7 +395,7 @@
// NewServerSettings structures record those fields of the Server structure to change
// when updating a server (see UpdateServer method).
type NewServerSettings struct {
- Name string `json:"name,omitempty"`
+ Name string `json:"name,omitempty"`
AccessIPv4 string `json:"accessIPv4,omitempty"`
AccessIPv6 string `json:"accessIPv6,omitempty"`
}
@@ -462,7 +462,7 @@
// Client applications will not use this structure (no API accepts an instance of this structure).
// See the Region method ResizeServer() for more details on how to resize a server.
type ResizeRequest struct {
- Name string `json:"name,omitempty"`
- FlavorRef string `json:"flavorRef"`
- DiskConfig string `json:"OS-DCF:diskConfig,omitempty"`
+ Name string `json:"name,omitempty"`
+ FlavorRef string `json:"flavorRef"`
+ DiskConfig string `json:"OS-DCF:diskConfig,omitempty"`
}
diff --git a/transport_double.go b/transport_double.go
index e764c9a..ef7f19a 100644
--- a/transport_double.go
+++ b/transport_double.go
@@ -2,10 +2,10 @@
import (
"encoding/json"
+ "fmt"
"io/ioutil"
"net/http"
"strings"
- "fmt"
"testing"
)
@@ -14,7 +14,7 @@
response string
expectTenantId bool
tenantIdFound bool
- status int
+ status int
}
func (t *transport) RoundTrip(req *http.Request) (rsp *http.Response, err error) {
@@ -100,4 +100,4 @@
return err
}
return nil
-}
\ No newline at end of file
+}