Remove unused ParseSHAFromURL function
parent
a4ce31f116
commit
a9309c3237
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue