Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(39)

Unified Diff: nova/nova.go

Issue 6867052: Return slices not pointers (Closed)
Patch Set: Return slices not pointers Created 12 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « glance/glance_test.go ('k') | nova/nova_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nova/nova.go
=== modified file 'nova/nova.go'
--- nova/nova.go 2012-12-03 23:51:42 +0000
+++ nova/nova.go 2012-12-04 01:13:46 +0000
@@ -63,7 +63,7 @@
}
// ListFlavorsDetail lists all details for available flavors.
-func (c *Client) ListFlavorsDetail() (*[]FlavorDetail, error) {
+func (c *Client) ListFlavorsDetail() ([]FlavorDetail, error) {
var resp struct {
Flavors []FlavorDetail
}
@@ -73,11 +73,11 @@
if err != nil {
return nil, err
}
- return &resp.Flavors, nil
+ return resp.Flavors, nil
}
// ListServers lists IDs, names, and links for all servers.
-func (c *Client) ListServers() (*[]Entity, error) {
+func (c *Client) ListServers() ([]Entity, error) {
var resp struct {
Servers []Entity
}
@@ -87,7 +87,7 @@
if err != nil {
return nil, err
}
- return &resp.Servers, nil
+ return resp.Servers, nil
}
type ServerDetail struct {
@@ -108,7 +108,7 @@
}
// ListServersDetail lists all details for available servers.
-func (c *Client) ListServersDetail() (*[]ServerDetail, error) {
+func (c *Client) ListServersDetail() ([]ServerDetail, error) {
var resp struct {
Servers []ServerDetail
}
@@ -118,7 +118,7 @@
if err != nil {
return nil, err
}
- return &resp.Servers, nil
+ return resp.Servers, nil
}
// GetServer lists details for the specified server.
@@ -200,7 +200,7 @@
}
// ListSecurityGroups lists IDs, names, and other details for all security groups.
-func (c *Client) ListSecurityGroups() (*[]SecurityGroup, error) {
+func (c *Client) ListSecurityGroups() ([]SecurityGroup, error) {
var resp struct {
Groups []SecurityGroup `json:"security_groups"`
}
@@ -210,11 +210,11 @@
if err != nil {
return nil, err
}
- return &resp.Groups, nil
+ return resp.Groups, nil
}
// GetServerSecurityGroups list security groups for a specific server.
-func (c *Client) GetServerSecurityGroups(serverId string) (*[]SecurityGroup, error) {
+func (c *Client) GetServerSecurityGroups(serverId string) ([]SecurityGroup, error) {
var resp struct {
Groups []SecurityGroup `json:"security_groups"`
@@ -226,7 +226,7 @@
if err != nil {
return nil, err
}
- return &resp.Groups, nil
+ return resp.Groups, nil
}
// CreateSecurityGroup creates a new security group.
@@ -340,7 +340,7 @@
}
// ListFloatingIPs lists floating IP addresses associated with the tenant or account.
-func (c *Client) ListFloatingIPs() (*[]FloatingIP, error) {
+func (c *Client) ListFloatingIPs() ([]FloatingIP, error) {
var resp struct {
FloatingIPs []FloatingIP `json:"floating_ips"`
}
@@ -351,7 +351,7 @@
if err != nil {
return nil, err
}
- return &resp.FloatingIPs, nil
+ return resp.FloatingIPs, nil
}
// GetFloatingIP lists details of the floating IP address associated with specified id.
« no previous file with comments | « glance/glance_test.go ('k') | nova/nova_test.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b