Skip to content

Commit 4521e06

Browse files
author
Mathieu Grzybek
committed
[console] add printing functions (message and error)
1 parent 1c796bf commit 4521e06

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

utils/console.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package utils
33
import (
44
"fmt"
55
"encoding/json"
6+
"os"
67
)
78

89
func PrintStruct(v interface{}) {
@@ -15,3 +16,12 @@ func PrintStructs(v []interface{}) {
1516
PrintStruct(i)
1617
}
1718
}
19+
20+
func PrintMessage(m string) {
21+
fmt.Print(m)
22+
}
23+
24+
func PrintErrorMessageAndExit(m string) {
25+
fmt.Print(m)
26+
os.Exit(1)
27+
}

0 commit comments

Comments
 (0)