Created
February 28, 2022 11:30
-
-
Save jlojosnegros/f56eeb7339e4f73522e6d2063da276ad to your computer and use it in GitHub Desktop.
Print K8s Object as JSON
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func printJson(tag string, elem interface{}) error { | |
jobj, err := json.MarshalIndent(elem, "", " ") | |
if err != nil { | |
return err | |
} | |
fmt.Printf("\n%s:\n%s\n", tag, string(jobj)) | |
return nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment