Skip to content

Commit 58fbe3f

Browse files
Fix newexpr lint: replace generic ptr helper with new(int64)
The modernize/newexpr linter flags the generic ptr[T] helper as an inlinable wrapper around new(). Replace the single usage with new(int64) and remove the helper function entirely.
1 parent 5a1c4cb commit 58fbe3f

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

api/v1/hypervisor_validation_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ var _ = Describe("Booking Helper Functions", func() {
823823
{Consumer: &ConsumerBooking{
824824
UUID: "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11",
825825
Resources: map[ResourceName]resource.Quantity{ResourceCPU: resource.MustParse("2"), ResourceMemory: resource.MustParse("4Gi")},
826-
ConsumerGeneration: ptr(int64(1)),
826+
ConsumerGeneration: new(int64),
827827
ConsumerType: "INSTANCE",
828828
ProjectID: "proj-123",
829829
UserID: "user-456",
@@ -943,5 +943,3 @@ var _ = Describe("Booking Helper Functions", func() {
943943
})
944944
})
945945
})
946-
947-
func ptr[T any](v T) *T { return &v }

0 commit comments

Comments
 (0)