@@ -331,15 +331,10 @@ func doTest(cmdline []string) {
331
331
332
332
// downloadSpecTestFixtures downloads and extracts the execution-spec-tests fixtures.
333
333
func downloadSpecTestFixtures (csdb * download.ChecksumDB , cachedir string ) string {
334
- executionSpecTestsVersion , err := csdb .FindVersion ("spec-tests" )
335
- if err != nil {
336
- log .Fatal (err )
337
- }
338
334
ext := ".tar.gz"
339
335
base := "fixtures_pectra-devnet-6" // TODO(s1na) rename once the version becomes part of the filename
340
- url := fmt .Sprintf ("https://github.com/ethereum/execution-spec-tests/releases/download/%s/%s%s" , executionSpecTestsVersion , base , ext )
341
336
archivePath := filepath .Join (cachedir , base + ext )
342
- if err := csdb .DownloadFile ( url , archivePath ); err != nil {
337
+ if err := csdb .DownloadFileFromKnownURL ( archivePath ); err != nil {
343
338
log .Fatal (err )
344
339
}
345
340
if err := build .ExtractArchive (archivePath , executionSpecTestsDir ); err != nil {
@@ -452,17 +447,15 @@ func downloadLinter(cachedir string) string {
452
447
}
453
448
arch := runtime .GOARCH
454
449
ext := ".tar.gz"
455
-
456
450
if runtime .GOOS == "windows" {
457
451
ext = ".zip"
458
452
}
459
453
if arch == "arm" {
460
454
arch += "v" + os .Getenv ("GOARM" )
461
455
}
462
456
base := fmt .Sprintf ("golangci-lint-%s-%s-%s" , version , runtime .GOOS , arch )
463
- url := fmt .Sprintf ("https://github.com/golangci/golangci-lint/releases/download/v%s/%s%s" , version , base , ext )
464
457
archivePath := filepath .Join (cachedir , base + ext )
465
- if err := csdb .DownloadFile ( url , archivePath ); err != nil {
458
+ if err := csdb .DownloadFileFromKnownURL ( archivePath ); err != nil {
466
459
log .Fatal (err )
467
460
}
468
461
if err := build .ExtractArchive (archivePath , cachedir ); err != nil {
@@ -511,10 +504,8 @@ func downloadProtocGenGo(cachedir string) string {
511
504
archiveName += ".tar.gz"
512
505
}
513
506
514
- url := fmt .Sprintf ("https://github.com/protocolbuffers/protobuf-go/releases/download/v%s/%s" , version , archiveName )
515
-
516
507
archivePath := path .Join (cachedir , archiveName )
517
- if err := csdb .DownloadFile ( url , archivePath ); err != nil {
508
+ if err := csdb .DownloadFileFromKnownURL ( archivePath ); err != nil {
518
509
log .Fatal (err )
519
510
}
520
511
extractDest := filepath .Join (cachedir , baseName )
@@ -544,10 +535,8 @@ func downloadProtoc(cachedir string) string {
544
535
545
536
fileName := fmt .Sprintf ("protoc-%s-%s" , version , baseName )
546
537
archiveFileName := fileName + ".zip"
547
- url := fmt .Sprintf ("https://github.com/protocolbuffers/protobuf/releases/download/v%s/%s" , version , archiveFileName )
548
538
archivePath := filepath .Join (cachedir , archiveFileName )
549
-
550
- if err := csdb .DownloadFile (url , archivePath ); err != nil {
539
+ if err := csdb .DownloadFileFromKnownURL (archivePath ); err != nil {
551
540
log .Fatal (err )
552
541
}
553
542
extractDest := filepath .Join (cachedir , fileName )
@@ -836,9 +825,8 @@ func downloadGoBootstrapSources(cachedir string) []string {
836
825
log .Fatal (err )
837
826
}
838
827
file := fmt .Sprintf ("go%s.src.tar.gz" , gobootVersion )
839
- url := "https://dl.google.com/go/" + file
840
828
dst := filepath .Join (cachedir , file )
841
- if err := csdb .DownloadFile (url , dst ); err != nil {
829
+ if err := csdb .DownloadFileFromKnownURL (url , dst ); err != nil {
842
830
log .Fatal (err )
843
831
}
844
832
bundles = append (bundles , dst )
@@ -854,9 +842,8 @@ func downloadGoSources(cachedir string) string {
854
842
log .Fatal (err )
855
843
}
856
844
file := fmt .Sprintf ("go%s.src.tar.gz" , dlgoVersion )
857
- url := "https://dl.google.com/go/" + file
858
845
dst := filepath .Join (cachedir , file )
859
- if err := csdb .DownloadFile (url , dst ); err != nil {
846
+ if err := csdb .DownloadFileFromKnownURL (url , dst ); err != nil {
860
847
log .Fatal (err )
861
848
}
862
849
return dst
0 commit comments