From 0c80cca674931c9dbfc69c25df24d53abbdd63a9 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 5 Jun 2016 14:26:16 +0200 Subject: 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 --- masterkey.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'masterkey.go') 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 -- cgit v1.2.3