no naked returns in go; fix auth v3 unit tests
diff --git a/openstack/db/v1/configurations/requests.go b/openstack/db/v1/configurations/requests.go
index 9e1bf05..8fc8295 100644
--- a/openstack/db/v1/configurations/requests.go
+++ b/openstack/db/v1/configurations/requests.go
@@ -54,11 +54,13 @@
return
}
_, r.Err = client.Post(baseURL(client), &b, &r.Body, &gophercloud.RequestOpts{OkCodes: []int{200}})
+ return
}
// Get will retrieve the details for a specified configuration group.
func Get(client *gophercloud.ServiceClient, configID string) (r GetResult) {
_, r.Err = client.Get(resourceURL(client, configID), &r.Body, nil)
+ return
}
// UpdateOptsBuilder is the top-level interface for casting update options into
@@ -96,6 +98,7 @@
return
}
_, r.Err = client.Patch(resourceURL(client, configID), &b, nil, nil)
+ return
}
// Replace will modify an existing configuration group by overwriting the
@@ -108,6 +111,7 @@
return
}
_, r.Err = client.Put(resourceURL(client, configID), &b, nil, nil)
+ return
}
// Delete will permanently delete a configuration group. Please note that
@@ -115,6 +119,7 @@
// you must detach and then delete them.
func Delete(client *gophercloud.ServiceClient, configID string) (r DeleteResult) {
_, r.Err = client.Delete(resourceURL(client, configID), nil)
+ return
}
// ListInstances will list all the instances associated with a particular
@@ -143,6 +148,7 @@
// operation.
func GetDatastoreParam(client *gophercloud.ServiceClient, datastoreID, versionID, paramID string) (r ParamResult) {
_, r.Err = client.Get(getDSParamURL(client, datastoreID, versionID, paramID), &r.Body, nil)
+ return
}
// ListGlobalParams is similar to ListDatastoreParams but does not require a
@@ -157,4 +163,5 @@
// DatastoreID.
func GetGlobalParam(client *gophercloud.ServiceClient, versionID, paramID string) (r ParamResult) {
_, r.Err = client.Get(getGlobalParamURL(client, versionID, paramID), &r.Body, nil)
+ return
}
diff --git a/openstack/db/v1/databases/requests.go b/openstack/db/v1/databases/requests.go
index f441d12..ef5394f 100644
--- a/openstack/db/v1/databases/requests.go
+++ b/openstack/db/v1/databases/requests.go
@@ -69,6 +69,7 @@
return
}
_, r.Err = client.Post(baseURL(client, instanceID), &b, nil, nil)
+ return
}
// List will list all of the databases for a specified instance. Note: this
@@ -84,4 +85,5 @@
// All contained data inside the database will also be permanently deleted.
func Delete(client *gophercloud.ServiceClient, instanceID, dbName string) (r DeleteResult) {
_, r.Err = client.Delete(dbURL(client, instanceID, dbName), nil)
+ return
}
diff --git a/openstack/db/v1/datastores/requests.go b/openstack/db/v1/datastores/requests.go
index aff397b..134e309 100644
--- a/openstack/db/v1/datastores/requests.go
+++ b/openstack/db/v1/datastores/requests.go
@@ -15,6 +15,7 @@
// Get will retrieve the details of a specified datastore type.
func Get(client *gophercloud.ServiceClient, datastoreID string) (r GetResult) {
_, r.Err = client.Get(resourceURL(client, datastoreID), &r.Body, nil)
+ return
}
// ListVersions will list all of the available versions for a specified
@@ -28,4 +29,5 @@
// GetVersion will retrieve the details of a specified datastore version.
func GetVersion(client *gophercloud.ServiceClient, datastoreID, versionID string) (r GetVersionResult) {
_, r.Err = client.Get(versionURL(client, datastoreID, versionID), &r.Body, nil)
+ return
}
diff --git a/openstack/db/v1/flavors/requests.go b/openstack/db/v1/flavors/requests.go
index a7cfeb5..7fac56a 100644
--- a/openstack/db/v1/flavors/requests.go
+++ b/openstack/db/v1/flavors/requests.go
@@ -17,4 +17,5 @@
// Get will retrieve information for a specified hardware flavor.
func Get(client *gophercloud.ServiceClient, id string) (r GetResult) {
_, r.Err = client.Get(getURL(client, id), &r.Body, nil)
+ return
}
diff --git a/openstack/db/v1/instances/requests.go b/openstack/db/v1/instances/requests.go
index 5e43078..4f06649 100644
--- a/openstack/db/v1/instances/requests.go
+++ b/openstack/db/v1/instances/requests.go
@@ -105,6 +105,7 @@
return
}
_, r.Err = client.Post(baseURL(client), &b, &r.Body, &gophercloud.RequestOpts{OkCodes: []int{200}})
+ return
}
// List retrieves the status and information for all database instances.
@@ -117,17 +118,20 @@
// Get retrieves the status and information for a specified database instance.
func Get(client *gophercloud.ServiceClient, id string) (r GetResult) {
_, r.Err = client.Get(resourceURL(client, id), &r.Body, nil)
+ return
}
// Delete permanently destroys the database instance.
func Delete(client *gophercloud.ServiceClient, id string) (r DeleteResult) {
_, r.Err = client.Delete(resourceURL(client, id), nil)
+ return
}
// EnableRootUser enables the login from any host for the root user and
// provides the user with a generated root password.
func EnableRootUser(client *gophercloud.ServiceClient, id string) (r EnableRootUserResult) {
_, r.Err = client.Post(userRootURL(client, id), nil, &r.Body, &gophercloud.RequestOpts{OkCodes: []int{200}})
+ return
}
// IsRootEnabled checks an instance to see if root access is enabled. It returns
@@ -135,6 +139,7 @@
// otherwise.
func IsRootEnabled(client *gophercloud.ServiceClient, id string) (r IsRootEnabledResult) {
_, r.Err = client.Get(userRootURL(client, id), &r.Body, nil)
+ return
}
// Restart will restart only the MySQL Instance. Restarting MySQL will
@@ -143,6 +148,7 @@
func Restart(client *gophercloud.ServiceClient, id string) (r ActionResult) {
b := map[string]interface{}{"restart": struct{}{}}
_, r.Err = client.Post(actionURL(client, id), &b, nil, nil)
+ return
}
// Resize changes the memory size of the instance, assuming a valid
@@ -150,6 +156,7 @@
func Resize(client *gophercloud.ServiceClient, id, flavorRef string) (r ActionResult) {
b := map[string]interface{}{"resize": map[string]string{"flavorRef": flavorRef}}
_, r.Err = client.Post(actionURL(client, id), &b, nil, nil)
+ return
}
// ResizeVolume will resize the attached volume for an instance. It supports
@@ -158,4 +165,5 @@
func ResizeVolume(client *gophercloud.ServiceClient, id string, size int) (r ActionResult) {
b := map[string]interface{}{"resize": map[string]interface{}{"volume": map[string]int{"size": size}}}
_, r.Err = client.Post(actionURL(client, id), &b, nil, nil)
+ return
}
diff --git a/openstack/db/v1/users/requests.go b/openstack/db/v1/users/requests.go
index c0bfa42..d342de3 100644
--- a/openstack/db/v1/users/requests.go
+++ b/openstack/db/v1/users/requests.go
@@ -72,6 +72,7 @@
return
}
_, r.Err = client.Post(baseURL(client, instanceID), &b, nil, nil)
+ return
}
// List will list all the users associated with a specified database instance,
@@ -86,4 +87,5 @@
// Delete will permanently delete a user from a specified database instance.
func Delete(client *gophercloud.ServiceClient, instanceID, userName string) (r DeleteResult) {
_, r.Err = client.Delete(userURL(client, instanceID, userName), nil)
+ return
}