fix go1.6 compatibility problem in tests #172
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://tip.golang.org/doc/go1.6
The reflect package has resolved a long-standing incompatibility between
the gc and gccgo toolchains regarding embedded unexported struct types
containing exported fields. Code that walks data structures using
reflection, especially to implement serialization in the spirit of the
encoding/json and encoding/xml packages, may need to be updated.
The problem arises when using reflection to walk through an embedded
unexported struct-typed field into an exported field of that struct. In
this case, reflect had incorrectly reported the embedded field as exported,
by returning an empty Field.PkgPath. Now it correctly reports the field as
unexported but ignores that fact when evaluating access to exported fields
contained within the struct.
Updating: Typically, code that previously walked over structs and used
f.PkgPath != ""
to exclude inaccessible fields should now use
f.PkgPath != "" && !f.Anonymous
For example, see the changes to the implementations of encoding/json and
encoding/xml.
Also see code for more details