Skip to content

Commit 8da7fbd

Browse files
committed
fix(iaas): use new() instead of utils.Ptr
1 parent 0021d52 commit 8da7fbd

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

‎internal/cmd/project/update/update_test.go‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66

77
"github.com/stackitcloud/stackit-cli/internal/pkg/globalflags"
88
"github.com/stackitcloud/stackit-cli/internal/pkg/testutils"
9-
"github.com/stackitcloud/stackit-cli/internal/pkg/utils"
109

1110
"github.com/google/go-cmp/cmp"
1211
"github.com/google/go-cmp/cmp/cmpopts"
@@ -41,8 +40,8 @@ func fixtureInputModel(mods ...func(model *inputModel)) *inputModel {
4140
ProjectId: testProjectId,
4241
Verbosity: globalflags.VerbosityDefault,
4342
},
44-
ParentId: utils.Ptr(testParentId),
45-
Name: utils.Ptr(nameFlag),
43+
ParentId: new(testParentId),
44+
Name: new(nameFlag),
4645
}
4746
for _, mod := range mods {
4847
mod(model)
@@ -53,8 +52,8 @@ func fixtureInputModel(mods ...func(model *inputModel)) *inputModel {
5352
func fixtureRequest(mods ...func(request *resourcemanager.ApiPartialUpdateProjectRequest)) resourcemanager.ApiPartialUpdateProjectRequest {
5453
request := testClient.DefaultAPI.PartialUpdateProject(testCtx, testProjectId)
5554
request = request.PartialUpdateProjectPayload(resourcemanager.PartialUpdateProjectPayload{
56-
ContainerParentId: utils.Ptr(testParentId),
57-
Name: utils.Ptr(nameFlag),
55+
ContainerParentId: new(testParentId),
56+
Name: new(nameFlag),
5857
})
5958
for _, mod := range mods {
6059
mod(&request)
@@ -102,8 +101,8 @@ func TestParseInput(t *testing.T) {
102101
expectedModel: fixtureInputModel(
103102
func(model *inputModel) {
104103
model.Labels = &map[string]*string{
105-
"key": utils.Ptr("value"),
106-
"foo": utils.Ptr("bar"),
104+
"key": new("value"),
105+
"foo": new("bar"),
107106
}
108107
}),
109108
isValid: true,
@@ -115,8 +114,8 @@ func TestParseInput(t *testing.T) {
115114
expectedModel: fixtureInputModel(
116115
func(model *inputModel) {
117116
model.Labels = &map[string]*string{
118-
"key": utils.Ptr("value"),
119-
"foo": utils.Ptr("bar"),
117+
"key": new("value"),
118+
"foo": new("bar"),
120119
}
121120
}),
122121
isValid: true,

0 commit comments

Comments
 (0)