runs 'gofmt -w *.go' on gopkg.in/yaml.v2
Henrik Jonsson
9 years ago
31 | 31 |
// Parser, produces a node tree out of a libyaml event stream.
|
32 | 32 |
|
33 | 33 |
type parser struct {
|
34 | |
parser yaml_parser_t
|
35 | |
event yaml_event_t
|
36 | |
doc *node
|
|
34 |
parser yaml_parser_t
|
|
35 |
event yaml_event_t
|
|
36 |
doc *node
|
37 | 37 |
}
|
38 | 38 |
|
39 | 39 |
func newParser(b []byte) *parser {
|
|
193 | 193 |
}
|
194 | 194 |
|
195 | 195 |
var (
|
196 | |
mapItemType = reflect.TypeOf(MapItem{})
|
197 | |
durationType = reflect.TypeOf(time.Duration(0))
|
|
196 |
mapItemType = reflect.TypeOf(MapItem{})
|
|
197 |
durationType = reflect.TypeOf(time.Duration(0))
|
198 | 198 |
defaultMapType = reflect.TypeOf(map[interface{}]interface{}{})
|
199 | |
ifaceType = defaultMapType.Elem()
|
|
199 |
ifaceType = defaultMapType.Elem()
|
200 | 200 |
)
|
201 | 201 |
|
202 | 202 |
func newDecoder() *decoder {
|
|
501 | 501 |
}
|
502 | 502 |
return true
|
503 | 503 |
}
|
504 | |
|
505 | |
|
506 | 504 |
|
507 | 505 |
func (d *decoder) mapping(n *node, out reflect.Value) (good bool) {
|
508 | 506 |
switch out.Kind() {
|
30 | 30 |
type Unmarshaler interface {
|
31 | 31 |
UnmarshalYAML(unmarshal func(interface{}) error) error
|
32 | 32 |
}
|
33 | |
|
34 | 33 |
|
35 | 34 |
// The Marshaler interface may be implemented by types to customize their
|
36 | 35 |
// behavior when being marshaled into a YAML document. The returned value
|
|
163 | 162 |
}
|
164 | 163 |
|
165 | 164 |
func failf(format string, args ...interface{}) {
|
166 | |
panic(yamlError{fmt.Errorf("yaml: " + format, args...)})
|
|
165 |
panic(yamlError{fmt.Errorf("yaml: "+format, args...)})
|
167 | 166 |
}
|
168 | 167 |
|
169 | 168 |
// A TypeError is returned by Unmarshal when one or more fields in
|
295 | 295 |
|
296 | 296 |
// Not in original libyaml.
|
297 | 297 |
yaml_BINARY_TAG = "tag:yaml.org,2002:binary"
|
298 | |
yaml_MERGE_TAG = "tag:yaml.org,2002:merge"
|
|
298 |
yaml_MERGE_TAG = "tag:yaml.org,2002:merge"
|
299 | 299 |
|
300 | 300 |
yaml_DEFAULT_SCALAR_TAG = yaml_STR_TAG // The default scalar tag is !!str.
|
301 | 301 |
yaml_DEFAULT_SEQUENCE_TAG = yaml_SEQ_TAG // The default sequence tag is !!seq.
|