Formating: Added some misc formatting

Signed-off-by: Morten Linderud <morten@linderud.pw>
This commit is contained in:
Morten Linderud 2021-09-05 14:42:31 +02:00
parent 69e52d3efb
commit 947b6ba8e8
No known key found for this signature in database
GPG Key ID: E742683BA08CB2FF
3 changed files with 3 additions and 3 deletions

View File

@ -70,7 +70,7 @@ func main() {
if strings.HasPrefix(err.Error(), "unknown comman") {
logging.Println(err.Error())
} else if errors.Is(err, os.ErrPermission) {
logging.Error(fmt.Errorf("sbtl requires root to run: %w", err))
logging.Error(fmt.Errorf("sbctl requires root to run: %w", err))
} else if errors.Is(err, sbctl.ErrImmutable) {
logging.Println("You need to chattr -i files in efivarfs")
} else if !errors.Is(err, ErrSilent) {

View File

@ -33,7 +33,7 @@ var signAllCmd = &cobra.Command{
if errors.Is(err, sbctl.ErrAlreadySigned) {
logging.Print("File have already been signed %s\n", entry.OutputFile)
} else if err != nil {
return err
return fmt.Errorf("failed signing %s: %w", entry.File, err)
} else {
logging.Ok("Signed %s", entry.OutputFile)
}

View File

@ -148,7 +148,7 @@ func VerifyFile(cert, file string) (bool, error) {
}
sigs, err := pecoff.GetSignatures(peFile)
if err != nil {
return false, err
return false, fmt.Errorf("%s: %w", file, err)
}
if len(sigs) == 0 {
return false, nil