Removing unnecessary 'err' vars
diff --git a/openstack/networking/v2/subnets/requests.go b/openstack/networking/v2/subnets/requests.go
index 591af24..153b3a2 100644
--- a/openstack/networking/v2/subnets/requests.go
+++ b/openstack/networking/v2/subnets/requests.go
@@ -85,12 +85,11 @@
// Get retrieves a specific subnet based on its unique ID.
func Get(c *gophercloud.ServiceClient, id string) GetResult {
var res GetResult
- _, err := perigee.Request("GET", getURL(c, id), perigee.Options{
+ _, res.Err = perigee.Request("GET", getURL(c, id), perigee.Options{
MoreHeaders: c.Provider.AuthenticatedHeaders(),
Results: &res.Resp,
OkCodes: []int{200},
})
- res.Err = err
return res
}
@@ -173,13 +172,12 @@
reqBody.Subnet.HostRoutes = opts.HostRoutes
}
- _, err := perigee.Request("POST", createURL(c), perigee.Options{
+ _, res.Err = perigee.Request("POST", createURL(c), perigee.Options{
MoreHeaders: c.Provider.AuthenticatedHeaders(),
ReqBody: &reqBody,
Results: &res.Resp,
OkCodes: []int{201},
})
- res.Err = err
return res
}
@@ -222,13 +220,12 @@
}
var res UpdateResult
- _, err := perigee.Request("PUT", updateURL(c, id), perigee.Options{
+ _, res.Err = perigee.Request("PUT", updateURL(c, id), perigee.Options{
MoreHeaders: c.Provider.AuthenticatedHeaders(),
ReqBody: &reqBody,
Results: &res.Resp,
OkCodes: []int{200, 201},
})
- res.Err = err
return res
}
@@ -236,10 +233,9 @@
// Delete accepts a unique ID and deletes the subnet associated with it.
func Delete(c *gophercloud.ServiceClient, id string) DeleteResult {
var res DeleteResult
- _, err := perigee.Request("DELETE", deleteURL(c, id), perigee.Options{
+ _, res.Err = perigee.Request("DELETE", deleteURL(c, id), perigee.Options{
MoreHeaders: c.Provider.AuthenticatedHeaders(),
OkCodes: []int{204},
})
- res.Err = err
return res
}