mirror of
https://github.com/celogeek/piwigo-cli.git
synced 2025-05-24 17:52:36 +02:00
22 lines
289 B
Go
22 lines
289 B
Go
/*
|
|
Debug tools
|
|
|
|
fmt.Println(debug.Dump(myStruct))
|
|
*/
|
|
package debug
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
/*
|
|
Dump an interface into a json string format
|
|
*/
|
|
func Dump(v interface{}) string {
|
|
result, err := json.MarshalIndent(v, "", " ")
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
return string(result)
|
|
}
|