File tree 3 files changed +6
-10
lines changed
3 files changed +6
-10
lines changed Original file line number Diff line number Diff line change 9
9
"strconv"
10
10
"strings"
11
11
12
+ "golang.org/x/exp/slices"
13
+
12
14
"github.com/pivotal-cf/go-pivnet/v6/logshim"
13
15
"github.com/pivotal-cf/pivnet-cli/v2/filter"
14
16
@@ -185,7 +187,7 @@ func (p *pivnetClient) getLatestStemcell(dependencies []pivnet.ReleaseDependency
185
187
186
188
for _ , dependency := range dependencies {
187
189
if strings .Contains (dependency .Release .Product .Slug , "stemcells" ) {
188
- if ! contains (stemcellSlugs , dependency .Release .Product .Slug ) {
190
+ if ! slices . Contains (stemcellSlugs , dependency .Release .Product .Slug ) {
189
191
stemcellSlugs = append (stemcellSlugs , dependency .Release .Product .Slug )
190
192
}
191
193
versions = append (versions , dependency .Release .Version )
@@ -204,15 +206,6 @@ func (p *pivnetClient) getLatestStemcell(dependencies []pivnet.ReleaseDependency
204
206
return stemcellSlugs [0 ], stemcellVersion , nil
205
207
}
206
208
207
- func contains (slice []string , str string ) bool {
208
- for _ , s := range slice {
209
- if s == str {
210
- return true
211
- }
212
- }
213
- return false
214
- }
215
-
216
209
const (
217
210
errorForVersion = "versioning of stemcell dependency in unexpected format: \" major.minor\" or \" major\" . the following version could not be parsed: %s"
218
211
userAgent = "om-download-product"
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ require (
30
30
github.com/pivotal-cf/replicator v0.0.0-20181127185712-7c58987ce14b
31
31
github.com/pivotal-cf/winfs-injector v0.0.0-20200827170301-91411420d92f
32
32
github.com/vmware/govmomi v0.44.1
33
+ golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
33
34
golang.org/x/oauth2 v0.23.0
34
35
google.golang.org/api v0.200.0
35
36
gopkg.in/go-playground/validator.v9 v9.31.0
Original file line number Diff line number Diff line change @@ -465,6 +465,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq
465
465
golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw =
466
466
golang.org/x/crypto v0.28.0 /go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U =
467
467
golang.org/x/exp v0.0.0-20190121172915-509febef88a4 /go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA =
468
+ golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8 =
469
+ golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 /go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY =
468
470
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3 /go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE =
469
471
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961 /go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU =
470
472
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f /go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE =
You can’t perform that action at this time.
0 commit comments