user errors.New if error formatting is not required

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
This commit is contained in:
Madhu Rajanna
2019-01-16 18:47:29 +05:30
parent 17f5c0a7ce
commit e42e66ff30
3 changed files with 16 additions and 14 deletions

View File

@ -102,7 +102,7 @@ func getMon(pOpts *rbdVolume, credentials map[string]string) (string, error) {
// if mons are set in secret, retrieve them
if len(pOpts.MonValueFromSecret) == 0 {
// yet another sanity check
return "", fmt.Errorf("either monitors or monValueFromSecret must be set")
return "", errors.New("either monitors or monValueFromSecret must be set")
}
val, ok := credentials[pOpts.MonValueFromSecret]
if !ok {
@ -344,7 +344,7 @@ func getSnapMon(pOpts *rbdSnapshot, credentials map[string]string) (string, erro
// if mons are set in secret, retrieve them
if len(pOpts.MonValueFromSecret) == 0 {
// yet another sanity check
return "", fmt.Errorf("either monitors or monValueFromSecret must be set")
return "", errors.New("either monitors or monValueFromSecret must be set")
}
val, ok := credentials[pOpts.MonValueFromSecret]
if !ok {