Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for YAMLToJSON (0.65 sec)

  1. operator/cmd/mesh/profile-dump.go

    func yamlToPrettyJSON(yml string) (string, error) {
    	// YAML objects are not completely compatible with JSON
    	// objects. Let yaml.YAMLToJSON handle the edge cases and
    	// we'll re-encode the result to pretty JSON.
    	uglyJSON, err := yaml.YAMLToJSON([]byte(yml))
    	if err != nil {
    		return "", err
    	}
    	var decoded any
    	if uglyJSON[0] == '[' {
    		decoded = make([]any, 0)
    	} else {
    Go
    - Registered: Wed Mar 20 22:53:08 GMT 2024
    - Last Modified: Fri Mar 15 01:18:49 GMT 2024
    - 7.1K bytes
    - Viewed (0)
Back to top