all: Tweak error creation (#6391)
- In the few places where we wrap errors, use the new Go 1.13 "%w" construction instead of %s or %v. - Where we create errors with constant strings, consistently use errors.New and not fmt.Errorf. - Remove capitalization from errors in the few places where we had that.
This commit is contained in:
@@ -15,6 +15,7 @@ import (
|
||||
"compress/gzip"
|
||||
"crypto/tls"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
@@ -366,10 +367,10 @@ func archiveFileVisitor(dir string, tempFile *string, signature *[]byte, archive
|
||||
|
||||
func verifyUpgrade(archiveName, tempName string, sig []byte) error {
|
||||
if tempName == "" {
|
||||
return fmt.Errorf("no upgrade found")
|
||||
return errors.New("no upgrade found")
|
||||
}
|
||||
if sig == nil {
|
||||
return fmt.Errorf("no signature found")
|
||||
return errors.New("no signature found")
|
||||
}
|
||||
|
||||
l.Debugf("checking signature\n%s", sig)
|
||||
|
||||
Reference in New Issue
Block a user