File tree 3 files changed +9
-13
lines changed
3 files changed +9
-13
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 @@ -29,9 +29,10 @@ require (
29
29
github.com/pivotal-cf/pivnet-cli/v2 v2.0.2
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
- github.com/vmware/govmomi v0.46.0
33
- golang.org/x/oauth2 v0.24.0
34
- google.golang.org/api v0.205.0
32
+ github.com/vmware/govmomi v0.44.1
33
+ golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
34
+ golang.org/x/oauth2 v0.23.0
35
+ google.golang.org/api v0.200.0
35
36
gopkg.in/go-playground/validator.v9 v9.31.0
36
37
gopkg.in/yaml.v2 v2.4.0
37
38
gopkg.in/yaml.v3 v3.0.1
Original file line number Diff line number Diff line change @@ -466,6 +466,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq
466
466
golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ =
467
467
golang.org/x/crypto v0.29.0 /go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg =
468
468
golang.org/x/exp v0.0.0-20190121172915-509febef88a4 /go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA =
469
+ golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8 =
470
+ golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 /go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY =
469
471
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3 /go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE =
470
472
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961 /go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU =
471
473
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