This commit adds logic to gracefully handle the new internal reflect.Value
structure on tip as of golang commit ecccf07e7f9d. It accomplishes this
by doing some inspection at init time and choosing the appropriate offsets
as well as modifying which offset is used for the value accordingly. As a
result, this allows spew to work properly with both the current release
version of Go as well as tip.
Fixes#15.
This commit moves the new code related to sorting reflect.Value items into
common.go since it is accessed by both the formatter and the dumper. It
also adds comments to the new functions and unexports SortValues since it
should be an internal function only.
In order to help future proof itself, spew handles unrecognized reflect
values by passing them on to the standard fmt library. Since spew handles
all current reflect values in the language, this condition has to be
manually tested with a bit of hackery by using unsafe to change the kind
to a nonexistent value.
As of this commit, there is now 100% test coverage.