@ -94,14 +94,20 @@ func tableLookup(v Values, simple string) (Values, error) {
if ! ok {
if ! ok {
return v , ErrNoTable
return v , ErrNoTable
}
}
//vv, ok := v2.(map[string]interface{})
if vv , ok := v2 . ( map [ string ] interface { } ) ; ok {
vv , ok := v2 . ( Values )
return vv , nil
if ! ok {
return vv , ErrNoTable
}
}
// This catches a case where a value is of type Values, but doesn't (for some
// reason) match the map[string]interface{}. This has been observed in the
// wild, and might be a result of a nil map of type Values.
if vv , ok := v2 . ( Values ) ; ok {
return vv , nil
return vv , nil
}
}
return map [ string ] interface { } { } , ErrNoTable
}
// ReadValues will parse YAML byte data into a Values.
// ReadValues will parse YAML byte data into a Values.
func ReadValues ( data [ ] byte ) ( vals Values , err error ) {
func ReadValues ( data [ ] byte ) ( vals Values , err error ) {
vals = make ( map [ string ] interface { } )
vals = make ( map [ string ] interface { } )