main: replace naked panic with log.Panic

Fix the check that failed to find the case as well.
This commit is contained in:
Jakob Unterwurzacher 2018-06-25 22:45:44 +02:00
parent 1a5e9cfb1e
commit 3f9a4bbcaa
2 changed files with 3 additions and 2 deletions

View File

@ -2,6 +2,7 @@ package main
import (
"fmt"
"log"
"os"
"path/filepath"
"runtime"
@ -89,7 +90,7 @@ func changePassword(args *argContainer) {
exitcodes.Exit(err)
}
if len(masterkey) == 0 {
panic("empty masterkey")
log.Panic("empty masterkey")
}
tlog.Info.Println("Please enter your new password.")
newPw := readpassword.Twice(args.extpass)

View File

@ -64,7 +64,7 @@ else
rm -Rf $TESTDIR
fi
if grep -R "panic(" internal ; then
if grep -R "panic(" *.go internal ; then
echo "Please use log.Panic instead of naked panic!"
exit 1
fi