Skip to content

Commit 0ed0fc7

Browse files
author
Mathieu Grzybek
committed
[console] add dedicated output functions
1 parent d0b4305 commit 0ed0fc7

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

utils/console.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package utils
2+
3+
import (
4+
"fmt"
5+
"encoding/json"
6+
)
7+
8+
func PrintStruct(v interface{}) {
9+
j, _ := json.Marshal(v)
10+
fmt.Println(string(j))
11+
}
12+
13+
func PrintStructs(v []interface{}) {
14+
for i := range(v) {
15+
PrintStruct(i)
16+
}
17+
}

0 commit comments

Comments
 (0)