func FormatYaml(writer io.Writer, value interface{}) error {
	if value == nil {
		return nil
	}
	result, err := goyaml.Marshal(value)
	if err != nil {
		return err
	}
	for i := len(result) - 1; i > 0; i-- {
		if result[i] != '\n' {
			break
		}
		result = result[:i]
	}

	if len(result) > 0 {
		result = append(result, '\n')
		_, err = writer.Write(result)
		return err
	}
	return nil
}
// FormatYaml writes out value as yaml to the writer, unless value is nil.
FormatYaml writes out value as yaml to the writer, unless value is nil.
// FormatYaml writes out value as yaml to the writer unless value is nil .
func FormatYaml(writer io.Writer, value interface{}) error {
	if value == nil {
		return nil
	}
	result, err := goyaml.Marshal(value)
	if err != nil {
		return err
	}
	for i := len(result) - 1; i > 0; i-- {
		if result[i] != '\n' {
			break
		}
		result = result[:i]
	}
	if len(result) > 0 {
		result = append(result, '\n')
		_, err = writer.Write(result)
		return err
	}
	return nil
}
func FormatYaml ( writer io . Writer , value interface { } ) error { if value == nil { return nil } result , err := goyaml . Marshal ( value ) if err != nil { return err } for i := len ( result ) - 1 ; i > 0 ; i -- { if result [ i ] != '\n' { break } result = result [ : i ] } if len ( result ) > 0 { result = append ( result , '\n' ) _ , err = writer . Write ( result ) return err } return nil }
FormatYaml writes out value as yaml to the writer, unless value is nil.
FormatYaml writes out value as yaml to the writer unless value is nil .