mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Error strings noncapitalized (#1704)
* Fix error string capitalization Error strings often follow another string. Hence, they should not be capitalized, unless referencing a name. * Uncapitalize more error strings While here, use %v on the error directly, which makes it easier to wrap the error later with %w if need be. * Uncapitalize more error strings While here, rename Url to URL as a nitpick.
This commit is contained in:
@@ -117,10 +117,12 @@ func makeGithubRequest(url string, output interface{}) error {
|
||||
response, err := client.Do(req)
|
||||
|
||||
if err != nil {
|
||||
//lint:ignore ST1005 Github is a proper capitalized noun
|
||||
return fmt.Errorf("Github API request failed: %s", err)
|
||||
}
|
||||
|
||||
if response.StatusCode != http.StatusOK {
|
||||
//lint:ignore ST1005 Github is a proper capitalized noun
|
||||
return fmt.Errorf("Github API request failed: %s", response.Status)
|
||||
}
|
||||
|
||||
@@ -128,12 +130,13 @@ func makeGithubRequest(url string, output interface{}) error {
|
||||
|
||||
data, err := ioutil.ReadAll(response.Body)
|
||||
if err != nil {
|
||||
//lint:ignore ST1005 Github is a proper capitalized noun
|
||||
return fmt.Errorf("Github API read response failed: %s", err)
|
||||
}
|
||||
|
||||
err = json.Unmarshal(data, output)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Unmarshalling Github API response failed: %s", err)
|
||||
return fmt.Errorf("unmarshalling Github API response failed: %s", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
@@ -196,7 +199,7 @@ func GetLatestVersion(shortHash bool) (latestVersion string, latestRelease strin
|
||||
}
|
||||
|
||||
if latestVersion == "" {
|
||||
return "", "", fmt.Errorf("No version found for \"%s\"", version)
|
||||
return "", "", fmt.Errorf("no version found for \"%s\"", version)
|
||||
}
|
||||
return latestVersion, latestRelease, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user