From 406cad6bb47dd7d9a123d005fb8ff766f6463051 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Wed, 23 Dec 2015 12:11:14 +1300 Subject: [PATCH] make compatible with Go 1.6 As documented at http://tip.golang.org/doc/go1.6#reflect, the rules around embedded unexported struct types containing exported fields are changing in Go 1.6. The same release notes explain how to change existing code, so do that. --- yaml.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yaml.go b/yaml.go index d133edf..36d6b88 100644 --- a/yaml.go +++ b/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 }