aboutsummaryrefslogtreecommitdiff
path: root/masterkey.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-06-05 14:26:16 +0200
committerJakob Unterwurzacher2016-06-05 14:32:07 +0200
commit0c80cca674931c9dbfc69c25df24d53abbdd63a9 (patch)
treec11cae555954fc08f3e28f22b6ed23ea5717a083 /masterkey.go
parentca54b665e32a9b298ea3e70b5da0108db3a71364 (diff)
toggledlog: convert remaing naked fmt.Print*
Several fatal errors were just printed to stdout, which meant they were invisible when running the test suite. Fix this by introducing toggledlog.Fatal and convert as follows: Fatal errors -> toggledlog.Fatal Warnings -> toggledlog.Warn Password prompts -> fmt.Fprintf
Diffstat (limited to 'masterkey.go')
-rw-r--r--masterkey.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/masterkey.go b/masterkey.go
index 8e28b32..5216f72 100644
--- a/masterkey.go
+++ b/masterkey.go
@@ -2,7 +2,6 @@ package main
import (
"encoding/hex"
- "fmt"
"os"
"strings"
@@ -45,11 +44,11 @@ func parseMasterKey(masterkey string) []byte {
masterkey = strings.Replace(masterkey, "-", "", -1)
key, err := hex.DecodeString(masterkey)
if err != nil {
- fmt.Printf("Could not parse master key: %v\n", err)
+ toggledlog.Fatal.Printf("Could not parse master key: %v\n", err)
os.Exit(1)
}
if len(key) != cryptocore.KeyLen {
- fmt.Printf("Master key has length %d but we require length %d\n", len(key), cryptocore.KeyLen)
+ toggledlog.Fatal.Printf("Master key has length %d but we require length %d\n", len(key), cryptocore.KeyLen)
os.Exit(1)
}
return key