mirror of
https://github.com/turbot/steampipe.git
synced 2026-02-15 04:00:14 -05:00
27 lines
502 B
Go
27 lines
502 B
Go
package utils
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
"os"
|
|
"strings"
|
|
|
|
"github.com/spf13/viper"
|
|
)
|
|
|
|
// functions specifically used for Debugging purposes.
|
|
func DebugDumpJSON(msg string, d interface{}) {
|
|
enc := json.NewEncoder(os.Stdout)
|
|
enc.SetIndent(" ", " ")
|
|
os.Stdout.WriteString(msg)
|
|
enc.Encode(d)
|
|
}
|
|
|
|
func DebugDumpViper() {
|
|
fmt.Println(strings.Repeat("*", 80))
|
|
for _, vKey := range viper.AllKeys() {
|
|
fmt.Printf("%-30s => %v\n", vKey, viper.Get(vKey))
|
|
}
|
|
fmt.Println(strings.Repeat("*", 80))
|
|
}
|