@@ -109,10 +109,10 @@ func findImg(ctx context.Context, client *coder.Client, email, imgName string) (
109
109
110
110
return nil , xerrors .New ("please refine your search" )
111
111
}
112
- return userImgs [0 ], nil
112
+ return & userImgs [0 ], nil
113
113
}
114
114
115
- func getImgs (ctx context.Context , client * coder.Client , userEmail string ) ([]* coder.Image , error ) {
115
+ func getImgs (ctx context.Context , client * coder.Client , userEmail string ) ([]coder.Image , error ) {
116
116
u , err := client .UserByEmail (ctx , userEmail )
117
117
if err != nil {
118
118
return nil , err
@@ -124,7 +124,7 @@ func getImgs(ctx context.Context, client *coder.Client, userEmail string) ([]*co
124
124
}
125
125
126
126
orgs = lookupUserOrgs (u , orgs )
127
- var importedImgs []* coder.Image
127
+ var importedImgs []coder.Image
128
128
129
129
// Get all of the imported images for all of the orgs the user belongs to.
130
130
for _ , org := range orgs {
@@ -138,7 +138,7 @@ func getImgs(ctx context.Context, client *coder.Client, userEmail string) ([]*co
138
138
}
139
139
140
140
// returns all images that contain imgName as a substring and have been imported by the user.
141
- func lookupUserImgs (ctx context.Context , client * coder.Client , email , imgName string ) ([]* coder.Image , error ) {
141
+ func lookupUserImgs (ctx context.Context , client * coder.Client , email , imgName string ) ([]coder.Image , error ) {
142
142
switch {
143
143
case client == nil :
144
144
return nil , xerrors .New ("nil client" )
@@ -154,7 +154,7 @@ func lookupUserImgs(ctx context.Context, client *coder.Client, email, imgName st
154
154
return nil , err
155
155
}
156
156
157
- var userImgs []* coder.Image
157
+ var userImgs []coder.Image
158
158
159
159
// The user may provide an image thats not an exact match
160
160
// to one of their imported images but they may be close.
@@ -167,7 +167,7 @@ func lookupUserImgs(ctx context.Context, client *coder.Client, email, imgName st
167
167
// If it's an exact match we can overwrite the slice and exit the loop
168
168
// since we won't need the fuzzy matched images anymore.
169
169
if img .Repository == imgName {
170
- userImgs = []* coder.Image {img }
170
+ userImgs = []coder.Image {img }
171
171
break
172
172
}
173
173
}
0 commit comments