TPT-4467: Change []*T to []T in all structs#972
Merged
zliang-akamai merged 1 commit intoMay 20, 2026
Conversation
[]*T to []T in all structs[]*T to []T in all structs
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to simplify the Linodego public API models by replacing slice-of-pointers fields ([]*T) with slice-of-values ([]T) across several structs and updating tests/fixtures accordingly.
Changes:
- Updated multiple SDK structs to use
[]Tinstead of[]*T(e.g.,Instance.IPv4, instance backup snapshot collections, instance IP collections, NodeBalancer create config list). - Updated unit/integration tests to account for value slices (dereferencing returned pointers before appending/assigning).
- Refreshed a number of integration VCR fixtures.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
nodebalancer.go |
Changes NodeBalancer create options configs from []*... to []... and adjusts JSON tags. |
instances.go |
Changes Instance.IPv4 from []*net.IP to []net.IP. |
instance_snapshots.go |
Changes backup snapshot collections from pointer slices to value slices (including Disks). |
instance_ips.go |
Changes several IP address collections from pointer slices to value slices. |
test/unit/nodebalancers_test.go |
Updates unit test to pass config create options as values rather than pointers. |
test/integration/waitfor_test.go |
Updates integration test to store created disks as values rather than pointers. |
test/integration/vlans_test.go |
Updates integration test to store created instances as values rather than pointers. |
test/integration/fixtures/TestVLANs_GetIPAMAddress.yaml |
Updates fixture recording for VLAN IPAM test flow (currently includes a failing instance-create interaction). |
test/integration/fixtures/TestPayment_GetMissing.yaml |
Updates headers/metadata in the recorded 404 payment fixture. |
test/integration/fixtures/TestPayment_GetFound.yaml |
Updates recorded payments list response (currently recorded as empty). |
test/integration/fixtures/TestOAuthClients_Reset.yaml |
Updates OAuth client reset-secret fixture recordings (IDs/timestamps/headers). |
test/integration/fixtures/TestOAuthClients_List.yaml |
Updates OAuth client list fixture recordings (IDs/timestamps/headers/body). |
test/integration/fixtures/TestOAuthClient_GetMissing.yaml |
Updates missing OAuth client fixture headers/metadata. |
test/integration/fixtures/TestOAuthClient_GetFound.yaml |
Updates found OAuth client fixture recordings (IDs/timestamps/headers). |
test/integration/fixtures/TestAccountNotifications_List.yaml |
Updates account notifications list fixture headers/metadata. |
test/integration/fixtures/TestAccountMaintenances_List.yaml |
Updates account maintenances list fixture headers/metadata. |
test/integration/fixtures/TestAccountLogins_List.yaml |
Updates account logins list fixture recordings (body expanded/updated). |
test/integration/fixtures/TestAccountEvents_List.yaml |
Updates account events list fixture recordings (body expanded/updated). |
test/integration/fixtures/TestAccountBetaPrograms.yaml |
Updates beta programs fixture (now recorded as empty list). |
test/integration/fixtures/TestAccountAvailability_List.yaml |
Updates account availability list fixture recordings (body expanded/updated). |
test/integration/fixtures/TestAccountAvailability_Get.yaml |
Updates account availability get fixture headers/metadata. |
test/integration/fixtures/TestAccountAgreements_List.yaml |
Updates account agreements fixture response payload/headers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a8a2a16 to
269db80
Compare
269db80 to
23be1f0
Compare
ezilber-akamai
approved these changes
May 20, 2026
lgarber-akamai
approved these changes
May 20, 2026
Contributor
lgarber-akamai
left a comment
There was a problem hiding this comment.
Seems to work well in my testing, nice work!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
Simplify things by changing all
[]*Tto[]T✔️ How to Test