Marshal serializes the value provided into a YAML document. The structure of the generated document will reflect the structure of the value itself. Maps and pointers (to struct, string, int, etc) are accepted as the in value. Struct fields are only marshalled if they are exported (have an upper cas
(in interface{})
| 216 | // yaml.Marshal(&T{F: 1}} // Returns "a: 1\nb: 0\n" |
| 217 | // |
| 218 | func Marshal(in interface{}) (out []byte, err error) { |
| 219 | defer handleErr(&err) |
| 220 | e := newEncoder() |
| 221 | defer e.destroy() |
| 222 | e.marshalDoc("", reflect.ValueOf(in)) |
| 223 | e.finish() |
| 224 | out = e.out |
| 225 | return |
| 226 | } |
| 227 | |
| 228 | // An Encoder writes YAML values to an output stream. |
| 229 | type Encoder struct { |
nothing calls this directly
no test coverage detected