Remove unused ParseSHAFromURL function

pull/4813/head
Thomas Stromberg 2019-07-19 16:36:26 -07:00
parent a4ce31f116
commit a9309c3237
1 changed files with 0 additions and 18 deletions

View File

@ -136,24 +136,6 @@ func RetryAfter(attempts int, callback func() error, d time.Duration) (err error
return m.ToError()
}
// ParseSHAFromURL downloads and reads a SHA checksum from an URL
func ParseSHAFromURL(url string) (string, error) {
r, err := retryablehttp.Get(url)
if err != nil {
return "", errors.Wrap(err, "Error downloading checksum.")
} else if r.StatusCode != http.StatusOK {
return "", errors.Errorf("Error downloading checksum. Got HTTP Error: %s", r.Status)
}
defer r.Body.Close()
body, err := ioutil.ReadAll(r.Body)
if err != nil {
return "", errors.Wrap(err, "Error reading checksum.")
}
return strings.Trim(string(body), "\n"), nil
}
// GetBinaryDownloadURL returns a suitable URL for the platform
func GetBinaryDownloadURL(version, platform string) string {
switch platform {