cleanup: address gomnd warnings

Direct usage of numbers should be avoided.

Issue reported:
mnd: Magic number: X, in <argument> detected (gomnd)

Signed-off-by: Yug <yuggupta27@gmail.com>
This commit is contained in:
Yug
2020-07-21 10:40:13 +05:30
committed by mergify[bot]
parent e73fe64a0d
commit 71ddf51544
11 changed files with 38 additions and 22 deletions

View File

@ -151,7 +151,7 @@ func (kms *VaultKMS) GetPassphrase(key string) (string, error) {
}
defer resp.Body.Close()
if resp.StatusCode == 404 {
if resp.StatusCode == http.StatusNotFound {
return "", MissingPassphrase{fmt.Errorf("passphrase for %s not found", key)}
}
err = kms.processError(resp, fmt.Sprintf("get passphrase for %s", key))
@ -219,7 +219,7 @@ func (kms *VaultKMS) DeletePassphrase(key string) error {
return fmt.Errorf("delete passphrase at %s request to vault failed: %s", key, err)
}
defer resp.Body.Close()
if resp.StatusCode != 404 {
if resp.StatusCode != http.StatusNotFound {
err = kms.processError(resp, "delete passphrase")
if err != nil {
return err