Skip to content

Commit 9faa4d3

Browse files
Change []*T to []T in all structs (#972)
1 parent 3e91ded commit 9faa4d3

9 files changed

Lines changed: 1656 additions & 769 deletions

instance_ips.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ type InstanceIPAddressResponse struct {
1212

1313
// InstanceIPv4Response contains the details of all IPv4 addresses associated with an Instance
1414
type InstanceIPv4Response struct {
15-
Public []*InstanceIP `json:"public"`
16-
Private []*InstanceIP `json:"private"`
17-
Shared []*InstanceIP `json:"shared"`
18-
Reserved []*InstanceIP `json:"reserved"`
19-
VPC []*VPCIP `json:"vpc"`
15+
Public []InstanceIP `json:"public"`
16+
Private []InstanceIP `json:"private"`
17+
Shared []InstanceIP `json:"shared"`
18+
Reserved []InstanceIP `json:"reserved"`
19+
VPC []VPCIP `json:"vpc"`
2020
}
2121

2222
// InstanceIP represents an Instance IP with additional DNS and networking details

instance_snapshots.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
// InstanceBackupsResponse response struct for backup snapshot
1212
type InstanceBackupsResponse struct {
13-
Automatic []*InstanceSnapshot `json:"automatic"`
13+
Automatic []InstanceSnapshot `json:"automatic"`
1414
Snapshot *InstanceBackupSnapshotResponse `json:"snapshot"`
1515
}
1616

@@ -32,16 +32,16 @@ type RestoreInstanceOptions struct {
3232

3333
// InstanceSnapshot represents a linode backup snapshot
3434
type InstanceSnapshot struct {
35-
ID int `json:"id"`
36-
Label string `json:"label"`
37-
Status InstanceSnapshotStatus `json:"status"`
38-
Type string `json:"type"`
39-
Created *time.Time `json:"-"`
40-
Updated *time.Time `json:"-"`
41-
Finished *time.Time `json:"-"`
42-
Configs []string `json:"configs"`
43-
Disks []*InstanceSnapshotDisk `json:"disks"`
44-
Available bool `json:"available"`
35+
ID int `json:"id"`
36+
Label string `json:"label"`
37+
Status InstanceSnapshotStatus `json:"status"`
38+
Type string `json:"type"`
39+
Created *time.Time `json:"-"`
40+
Updated *time.Time `json:"-"`
41+
Finished *time.Time `json:"-"`
42+
Configs []string `json:"configs"`
43+
Disks []InstanceSnapshotDisk `json:"disks"`
44+
Available bool `json:"available"`
4545
}
4646

4747
// InstanceSnapshotDisk fields represent the source disk of a Snapshot

instances.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ type Instance struct {
5757
Backups *InstanceBackup `json:"backups"`
5858
Image string `json:"image"`
5959
Group string `json:"group"`
60-
IPv4 []*net.IP `json:"ipv4"`
60+
IPv4 []net.IP `json:"ipv4"`
6161
IPv6 string `json:"ipv6"`
6262
Label string `json:"label"`
6363
Type string `json:"type"`

nodebalancer.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ type NodeBalancerCreateOptions struct {
7272
// NOTE: ClientUDPSessThrottle may not currently be available to all users.
7373
ClientUDPSessThrottle *int `json:"client_udp_sess_throttle,omitzero"`
7474

75-
Configs []*NodeBalancerConfigCreateOptions `json:"configs,omitzero"`
76-
Tags []string `json:"tags"`
77-
FirewallID int `json:"firewall_id,omitzero"`
78-
Type NodeBalancerPlanType `json:"type,omitzero"`
79-
VPCs []NodeBalancerVPCOptions `json:"vpcs,omitzero"`
80-
IPv4 *string `json:"ipv4,omitzero"`
75+
Configs []NodeBalancerConfigCreateOptions `json:"configs,omitzero"`
76+
Tags []string `json:"tags"`
77+
FirewallID int `json:"firewall_id,omitzero"`
78+
Type NodeBalancerPlanType `json:"type,omitzero"`
79+
VPCs []NodeBalancerVPCOptions `json:"vpcs,omitzero"`
80+
IPv4 *string `json:"ipv4,omitzero"`
8181
}
8282

8383
// NodeBalancerUpdateOptions are the options permitted for UpdateNodeBalancer

test/integration/fixtures/TestEventPoller_Secondary.yaml

Lines changed: 928 additions & 324 deletions
Large diffs are not rendered by default.

test/integration/fixtures/TestVLANs_List.yaml

Lines changed: 700 additions & 417 deletions
Large diffs are not rendered by default.

test/integration/vlans_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ func TestVLANs_List_smoke(t *testing.T) {
1919
client, fixturesTeardown := createTestClient(t, "fixtures/TestVLANs_List")
2020
defer fixturesTeardown()
2121

22-
var instances []*linodego.Instance
22+
var instances []linodego.Instance
2323
for i := 0; i < 2; i++ {
2424
instance, instanceTeardown, err := createVLANInstance(t, client, fmt.Sprintf("%s-%d", instancePrefix, i), vlanName)
2525
if err != nil {
2626
t.Fatal(err)
2727
}
2828
defer instanceTeardown()
2929

30-
instances = append(instances, instance)
30+
instances = append(instances, *instance)
3131
}
3232

3333
for _, instance := range instances {

test/integration/waitfor_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ func TestEventPoller_Secondary(t *testing.T) {
177177
}
178178

179179
// Create two instance disks
180-
disks := make([]*linodego.InstanceDisk, 2)
180+
disks := make([]linodego.InstanceDisk, 2)
181181

182182
for i := 0; i < 2; i++ {
183183
disk, err := client.CreateInstanceDisk(context.Background(), instance.ID, linodego.InstanceDiskCreateOptions{
@@ -188,7 +188,7 @@ func TestEventPoller_Secondary(t *testing.T) {
188188
t.Fatalf("failed to create instance disk: %s", err)
189189
}
190190

191-
disks[i] = disk
191+
disks[i] = *disk
192192
}
193193

194194
// Poll for the first disk to be deleted

test/unit/nodebalancers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func TestNodeBalancers_UDP(t *testing.T) {
2424
Label: linodego.Pointer("foobar"),
2525
Region: "us-mia",
2626
ClientUDPSessThrottle: linodego.Pointer(5),
27-
Configs: []*linodego.NodeBalancerConfigCreateOptions{
27+
Configs: []linodego.NodeBalancerConfigCreateOptions{
2828
{
2929
Protocol: linodego.ProtocolUDP,
3030
Port: 1234,

0 commit comments

Comments
 (0)