Browse Source

Merge pull request #152 from mwhudson/go16-compat

Fix anonymous field handling for Go 1.6.
Gustavo Niemeyer 10 years ago
parent
commit
a83829b6f1
1 changed files with 1 additions and 1 deletions
  1. 1 1
      yaml.go

+ 1 - 1
yaml.go

@@ -222,7 +222,7 @@ func getStructInfo(st reflect.Type) (*structInfo, error) {
 	inlineMap := -1
 	for i := 0; i != n; i++ {
 		field := st.Field(i)
-		if field.PkgPath != "" {
+		if field.PkgPath != "" && !field.Anonymous {
 			continue // Private field
 		}