package formatters
import (
"gopkg.in/yaml.v3"
)
type yamlFormatter struct {}
func NewYAMLFormatter() *yamlFormatter {
return &yamlFormatter{}
}
func (jf *yamlFormatter) Serialise(v interface{}) string {
b, err := yaml.Marshal(v)
if err != nil {
return ""}
return string(b)
}
|
The pages are generated with Golds v0.3.2. (GOOS=linux 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. |