Removing unnecessary 'err' vars
diff --git a/openstack/networking/v2/networks/requests.go b/openstack/networking/v2/networks/requests.go
index 180914f..9b52c8d 100644
--- a/openstack/networking/v2/networks/requests.go
+++ b/openstack/networking/v2/networks/requests.go
@@ -81,12 +81,11 @@
// Get retrieves a specific network 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
}
@@ -139,13 +138,12 @@
reqBody := opts.ToMap()
// Send request to API
- _, 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
}
@@ -190,23 +188,22 @@
reqBody := opts.ToMap()
// Send request to API
- _, err := perigee.Request("PUT", getURL(c, networkID), perigee.Options{
+ _, res.Err = perigee.Request("PUT", getURL(c, networkID), perigee.Options{
MoreHeaders: c.Provider.AuthenticatedHeaders(),
ReqBody: &reqBody,
Results: &res.Resp,
OkCodes: []int{200, 201},
})
- res.Err = err
+
return res
}
// Delete accepts a unique ID and deletes the network associated with it.
func Delete(c *gophercloud.ServiceClient, networkID string) DeleteResult {
var res DeleteResult
- _, err := perigee.Request("DELETE", deleteURL(c, networkID), perigee.Options{
+ _, res.Err = perigee.Request("DELETE", deleteURL(c, networkID), perigee.Options{
MoreHeaders: c.Provider.AuthenticatedHeaders(),
OkCodes: []int{204},
})
- res.Err = err
return res
}