no naked returns in go; fix auth v3 unit tests
diff --git a/openstack/orchestration/v1/buildinfo/requests.go b/openstack/orchestration/v1/buildinfo/requests.go
index f0e3ec4..32f6032 100644
--- a/openstack/orchestration/v1/buildinfo/requests.go
+++ b/openstack/orchestration/v1/buildinfo/requests.go
@@ -5,4 +5,5 @@
// Get retreives data for the given stack template.
func Get(c *gophercloud.ServiceClient) (r GetResult) {
_, r.Err = c.Get(getURL(c), &r.Body, nil)
+ return
}
diff --git a/openstack/orchestration/v1/stackevents/requests.go b/openstack/orchestration/v1/stackevents/requests.go
index c3ae4b1..e6e7f79 100644
--- a/openstack/orchestration/v1/stackevents/requests.go
+++ b/openstack/orchestration/v1/stackevents/requests.go
@@ -8,6 +8,7 @@
// Find retrieves stack events for the given stack name.
func Find(c *gophercloud.ServiceClient, stackName string) (r FindResult) {
_, r.Err = c.Get(findURL(c, stackName), &r.Body, nil)
+ return
}
// SortDir is a type for specifying in which direction to sort a list of events.
@@ -177,4 +178,5 @@
// Get retreives data for the given stack resource.
func Get(c *gophercloud.ServiceClient, stackName, stackID, resourceName, eventID string) (r GetResult) {
_, r.Err = c.Get(getURL(c, stackName, stackID, resourceName, eventID), &r.Body, nil)
+ return
}
diff --git a/openstack/orchestration/v1/stackresources/requests.go b/openstack/orchestration/v1/stackresources/requests.go
index cc4b990..f368b76 100644
--- a/openstack/orchestration/v1/stackresources/requests.go
+++ b/openstack/orchestration/v1/stackresources/requests.go
@@ -8,6 +8,7 @@
// Find retrieves stack resources for the given stack name.
func Find(c *gophercloud.ServiceClient, stackName string) (r FindResult) {
_, r.Err = c.Get(findURL(c, stackName), &r.Body, nil)
+ return
}
// ListOptsBuilder allows extensions to add additional parameters to the
@@ -47,11 +48,13 @@
// Get retreives data for the given stack resource.
func Get(c *gophercloud.ServiceClient, stackName, stackID, resourceName string) (r GetResult) {
_, r.Err = c.Get(getURL(c, stackName, stackID, resourceName), &r.Body, nil)
+ return
}
// Metadata retreives the metadata for the given stack resource.
func Metadata(c *gophercloud.ServiceClient, stackName, stackID, resourceName string) (r MetadataResult) {
_, r.Err = c.Get(metadataURL(c, stackName, stackID, resourceName), &r.Body, nil)
+ return
}
// ListTypes makes a request against the API to list resource types.
@@ -64,9 +67,11 @@
// Schema retreives the schema for the given resource type.
func Schema(c *gophercloud.ServiceClient, resourceType string) (r SchemaResult) {
_, r.Err = c.Get(schemaURL(c, resourceType), &r.Body, nil)
+ return
}
// Template retreives the template representation for the given resource type.
func Template(c *gophercloud.ServiceClient, resourceType string) (r TemplateResult) {
_, r.Err = c.Get(templateURL(c, resourceType), &r.Body, nil)
+ return
}
diff --git a/openstack/orchestration/v1/stacks/requests.go b/openstack/orchestration/v1/stacks/requests.go
index 46d0f46..91f38ee 100644
--- a/openstack/orchestration/v1/stacks/requests.go
+++ b/openstack/orchestration/v1/stacks/requests.go
@@ -93,6 +93,7 @@
return
}
_, r.Err = c.Post(createURL(c), b, &r.Body, nil)
+ return
}
// AdoptOptsBuilder is the interface options structs have to satisfy in order
@@ -181,6 +182,7 @@
return
}
_, r.Err = c.Post(adoptURL(c), b, &r.Body, nil)
+ return
}
// SortDir is a type for specifying in which direction to sort a list of stacks.
@@ -252,10 +254,9 @@
}
// Get retreives a stack based on the stack name and stack ID.
-func Get(c *gophercloud.ServiceClient, stackName, stackID string) GetResult {
- var r GetResult
+func Get(c *gophercloud.ServiceClient, stackName, stackID string) (r GetResult) {
_, r.Err = c.Get(getURL(c, stackName, stackID), &r.Body, nil)
- return r
+ return
}
// UpdateOptsBuilder is the interface options structs have to satisfy in order
@@ -336,11 +337,13 @@
return
}
_, r.Err = c.Put(updateURL(c, stackName, stackID), b, nil, nil)
+ return
}
// Delete deletes a stack based on the stack name and stack ID.
func Delete(c *gophercloud.ServiceClient, stackName, stackID string) (r DeleteResult) {
_, r.Err = c.Delete(deleteURL(c, stackName, stackID), nil)
+ return
}
// PreviewOptsBuilder is the interface options structs have to satisfy in order
@@ -423,6 +426,7 @@
_, r.Err = c.Post(previewURL(c), b, &r.Body, &gophercloud.RequestOpts{
OkCodes: []int{200},
})
+ return
}
// Abandon deletes the stack with the provided stackName and stackID, but leaves its
@@ -432,4 +436,5 @@
JSONResponse: &r.Body,
OkCodes: []int{200},
})
+ return
}
diff --git a/openstack/orchestration/v1/stacktemplates/requests.go b/openstack/orchestration/v1/stacktemplates/requests.go
index 57f990f..d248c24 100644
--- a/openstack/orchestration/v1/stacktemplates/requests.go
+++ b/openstack/orchestration/v1/stacktemplates/requests.go
@@ -5,6 +5,7 @@
// Get retreives data for the given stack template.
func Get(c *gophercloud.ServiceClient, stackName, stackID string) (r GetResult) {
_, r.Err = c.Get(getURL(c, stackName, stackID), &r.Body, nil)
+ return
}
// ValidateOptsBuilder describes struct types that can be accepted by the Validate call.
@@ -34,4 +35,5 @@
_, r.Err = c.Post(validateURL(c), b, &r.Body, &gophercloud.RequestOpts{
OkCodes: []int{200},
})
+ return
}