named return vars
diff --git a/openstack/orchestration/v1/buildinfo/requests.go b/openstack/orchestration/v1/buildinfo/requests.go
index ad12a73..f0e3ec4 100644
--- a/openstack/orchestration/v1/buildinfo/requests.go
+++ b/openstack/orchestration/v1/buildinfo/requests.go
@@ -3,8 +3,6 @@
import "github.com/gophercloud/gophercloud"
// Get retreives data for the given stack template.
-func Get(c *gophercloud.ServiceClient) GetResult {
- var r GetResult
+func Get(c *gophercloud.ServiceClient) (r GetResult) {
_, r.Err = c.Get(getURL(c), &r.Body, nil)
- return r
}
diff --git a/openstack/orchestration/v1/stackevents/requests.go b/openstack/orchestration/v1/stackevents/requests.go
index 794d4c8..c3ae4b1 100644
--- a/openstack/orchestration/v1/stackevents/requests.go
+++ b/openstack/orchestration/v1/stackevents/requests.go
@@ -6,10 +6,8 @@
)
// Find retrieves stack events for the given stack name.
-func Find(c *gophercloud.ServiceClient, stackName string) FindResult {
- var r FindResult
+func Find(c *gophercloud.ServiceClient, stackName string) (r FindResult) {
_, r.Err = c.Get(findURL(c, stackName), &r.Body, nil)
- return r
}
// SortDir is a type for specifying in which direction to sort a list of events.
@@ -177,10 +175,6 @@
}
// Get retreives data for the given stack resource.
-func Get(c *gophercloud.ServiceClient, stackName, stackID, resourceName, eventID string) GetResult {
- var r GetResult
- _, r.Err = c.Get(getURL(c, stackName, stackID, resourceName, eventID), &r.Body, &gophercloud.RequestOpts{
- OkCodes: []int{200},
- })
- return r
+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)
}
diff --git a/openstack/orchestration/v1/stackresources/requests.go b/openstack/orchestration/v1/stackresources/requests.go
index 608ce90..cc4b990 100644
--- a/openstack/orchestration/v1/stackresources/requests.go
+++ b/openstack/orchestration/v1/stackresources/requests.go
@@ -6,10 +6,8 @@
)
// Find retrieves stack resources for the given stack name.
-func Find(c *gophercloud.ServiceClient, stackName string) FindResult {
- var r FindResult
+func Find(c *gophercloud.ServiceClient, stackName string) (r FindResult) {
_, r.Err = c.Get(findURL(c, stackName), &r.Body, nil)
- return r
}
// ListOptsBuilder allows extensions to add additional parameters to the
@@ -47,17 +45,13 @@
}
// Get retreives data for the given stack resource.
-func Get(c *gophercloud.ServiceClient, stackName, stackID, resourceName string) GetResult {
- var r GetResult
+func Get(c *gophercloud.ServiceClient, stackName, stackID, resourceName string) (r GetResult) {
_, r.Err = c.Get(getURL(c, stackName, stackID, resourceName), &r.Body, nil)
- return r
}
// Metadata retreives the metadata for the given stack resource.
-func Metadata(c *gophercloud.ServiceClient, stackName, stackID, resourceName string) MetadataResult {
- var r MetadataResult
+func Metadata(c *gophercloud.ServiceClient, stackName, stackID, resourceName string) (r MetadataResult) {
_, r.Err = c.Get(metadataURL(c, stackName, stackID, resourceName), &r.Body, nil)
- return r
}
// ListTypes makes a request against the API to list resource types.
@@ -68,15 +62,11 @@
}
// Schema retreives the schema for the given resource type.
-func Schema(c *gophercloud.ServiceClient, resourceType string) SchemaResult {
- var r SchemaResult
+func Schema(c *gophercloud.ServiceClient, resourceType string) (r SchemaResult) {
_, r.Err = c.Get(schemaURL(c, resourceType), &r.Body, nil)
- return r
}
// Template retreives the template representation for the given resource type.
-func Template(c *gophercloud.ServiceClient, resourceType string) TemplateResult {
- var r TemplateResult
+func Template(c *gophercloud.ServiceClient, resourceType string) (r TemplateResult) {
_, r.Err = c.Get(templateURL(c, resourceType), &r.Body, nil)
- return r
}
diff --git a/openstack/orchestration/v1/stacks/requests.go b/openstack/orchestration/v1/stacks/requests.go
index 04c5150..46d0f46 100644
--- a/openstack/orchestration/v1/stacks/requests.go
+++ b/openstack/orchestration/v1/stacks/requests.go
@@ -86,15 +86,13 @@
// Create accepts a CreateOpts struct and creates a new stack using the values
// provided.
-func Create(c *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult {
- var r CreateResult
+func Create(c *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult) {
b, err := opts.ToStackCreateMap()
if err != nil {
r.Err = err
- return r
+ return
}
_, r.Err = c.Post(createURL(c), b, &r.Body, nil)
- return r
}
// AdoptOptsBuilder is the interface options structs have to satisfy in order
@@ -176,15 +174,13 @@
// Adopt accepts an AdoptOpts struct and creates a new stack using the resources
// from another stack.
-func Adopt(c *gophercloud.ServiceClient, opts AdoptOptsBuilder) AdoptResult {
- var r AdoptResult
+func Adopt(c *gophercloud.ServiceClient, opts AdoptOptsBuilder) (r AdoptResult) {
b, err := opts.ToStackAdoptMap()
if err != nil {
r.Err = err
- return r
+ return
}
_, r.Err = c.Post(adoptURL(c), b, &r.Body, nil)
- return r
}
// SortDir is a type for specifying in which direction to sort a list of stacks.
@@ -333,22 +329,18 @@
// Update accepts an UpdateOpts struct and updates an existing stack using the values
// provided.
-func Update(c *gophercloud.ServiceClient, stackName, stackID string, opts UpdateOptsBuilder) UpdateResult {
- var r UpdateResult
+func Update(c *gophercloud.ServiceClient, stackName, stackID string, opts UpdateOptsBuilder) (r UpdateResult) {
b, err := opts.ToStackUpdateMap()
if err != nil {
r.Err = err
- return r
+ return
}
_, r.Err = c.Put(updateURL(c, stackName, stackID), b, nil, nil)
- return r
}
// Delete deletes a stack based on the stack name and stack ID.
-func Delete(c *gophercloud.ServiceClient, stackName, stackID string) DeleteResult {
- var r DeleteResult
+func Delete(c *gophercloud.ServiceClient, stackName, stackID string) (r DeleteResult) {
_, r.Err = c.Delete(deleteURL(c, stackName, stackID), nil)
- return r
}
// PreviewOptsBuilder is the interface options structs have to satisfy in order
@@ -422,26 +414,22 @@
// Preview accepts a PreviewOptsBuilder interface and creates a preview of a stack using the values
// provided.
-func Preview(c *gophercloud.ServiceClient, opts PreviewOptsBuilder) PreviewResult {
- var r PreviewResult
+func Preview(c *gophercloud.ServiceClient, opts PreviewOptsBuilder) (r PreviewResult) {
b, err := opts.ToStackPreviewMap()
if err != nil {
r.Err = err
- return r
+ return
}
_, r.Err = c.Post(previewURL(c), b, &r.Body, &gophercloud.RequestOpts{
OkCodes: []int{200},
})
- return r
}
// Abandon deletes the stack with the provided stackName and stackID, but leaves its
// resources intact, and returns data describing the stack and its resources.
-func Abandon(c *gophercloud.ServiceClient, stackName, stackID string) AbandonResult {
- var r AbandonResult
+func Abandon(c *gophercloud.ServiceClient, stackName, stackID string) (r AbandonResult) {
_, r.Err = c.Delete(abandonURL(c, stackName, stackID), &gophercloud.RequestOpts{
JSONResponse: &r.Body,
OkCodes: []int{200},
})
- return r
}
diff --git a/openstack/orchestration/v1/stacktemplates/requests.go b/openstack/orchestration/v1/stacktemplates/requests.go
index 9337cae..57f990f 100644
--- a/openstack/orchestration/v1/stacktemplates/requests.go
+++ b/openstack/orchestration/v1/stacktemplates/requests.go
@@ -3,10 +3,8 @@
import "github.com/gophercloud/gophercloud"
// Get retreives data for the given stack template.
-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
}
// ValidateOptsBuilder describes struct types that can be accepted by the Validate call.
@@ -27,15 +25,13 @@
}
// Validate validates the given stack template.
-func Validate(c *gophercloud.ServiceClient, opts ValidateOptsBuilder) ValidateResult {
- var r ValidateResult
+func Validate(c *gophercloud.ServiceClient, opts ValidateOptsBuilder) (r ValidateResult) {
b, err := opts.ToStackTemplateValidateMap()
if err != nil {
r.Err = err
- return r
+ return
}
_, r.Err = c.Post(validateURL(c), b, &r.Body, &gophercloud.RequestOpts{
OkCodes: []int{200},
})
- return r
}