Source File
yaml.go
Belonging Package
github.com/ghodss/yaml
package yaml
import (
)
func ( []byte) ([]byte, error) {
return yamlToJSON(, nil)
}
, := convertToJSONableObject(, )
if != nil {
return nil,
}
if != nil {
switch typedYAMLObj := .(type) {
var string
switch typedVal := .(type) {
case int:
= strconv.FormatInt(int64(), 10)
case int64:
= strconv.FormatInt(, 10)
case float64:
= strconv.FormatFloat(, 'g', -1, 32)
case uint64:
= strconv.FormatUint(, 10)
case bool:
if {
= "true"
} else {
= "false"
}
}
if len() > 0 {
= interface{}()
}
}
return , nil
}
return nil, nil
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |