mirror of
https://github.com/celogeek/piwigo-cli.git
synced 2025-05-25 02:02:37 +02:00
stream to stdout
This commit is contained in:
parent
234a63f208
commit
8697fa0956
@ -1,14 +1,20 @@
|
|||||||
|
/*
|
||||||
|
Debug tools
|
||||||
|
|
||||||
|
debug.Dump(myStruct)
|
||||||
|
*/
|
||||||
package debug
|
package debug
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Dump(v interface{}) (err error) {
|
/*
|
||||||
b, err := json.MarshalIndent(v, "", " ")
|
Dump an interface to the stdout
|
||||||
if err == nil {
|
*/
|
||||||
fmt.Println(string(b))
|
func Dump(v interface{}) error {
|
||||||
}
|
d := json.NewEncoder(os.Stdout)
|
||||||
return
|
d.SetIndent("", " ")
|
||||||
|
return d.Encode(v)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user