Skip to content

Commit c97ddc6

Browse files
alnrrafiss
authored andcommitted
feat: expose DownloadBinary function
1 parent e5902a9 commit c97ddc6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

testserver/binaries.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ func GetDownloadResponse(desiredVersion string, nonStable bool) (*http.Response,
118118
return response, desiredVersion, nil
119119
}
120120

121-
// downloadBinary saves the latest version of CRDB into a local binary file,
121+
// DownloadBinary saves the latest version of CRDB into a local binary file,
122122
// and returns the path for this local binary.
123123
// To download a specific cockroach version, specify desiredVersion. Otherwise,
124124
// the latest stable or non-stable version will be chosen.
125125
// To download the latest STABLE version of CRDB, set `nonStable` to false.
126126
// To download the bleeding edge version of CRDB, set `nonStable` to true.
127-
func downloadBinary(tc *TestConfig, desiredVersion string, nonStable bool) (string, error) {
127+
func DownloadBinary(tc *TestConfig, desiredVersion string, nonStable bool) (string, error) {
128128
response, desiredVersion, err := GetDownloadResponse(desiredVersion, nonStable)
129129
if err != nil {
130130
return "", err

testserver/testserver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ func NewTestServer(opts ...TestServerOpt) (TestServer, error) {
442442
serverArgs.cockroachBinary = cockroachBinary
443443
}
444444
} else {
445-
serverArgs.cockroachBinary, err = downloadBinary(&serverArgs.testConfig, serverArgs.customVersion, serverArgs.nonStableDB)
445+
serverArgs.cockroachBinary, err = DownloadBinary(&serverArgs.testConfig, serverArgs.customVersion, serverArgs.nonStableDB)
446446
if err != nil {
447447
if errors.Is(err, errStoppedInMiddle) {
448448
// If the testserver is intentionally killed in the middle of downloading,

0 commit comments

Comments
 (0)