This adds a new build tag named "safe" which serves the exact same
purpose as the current "disableunsafe" tag. This is being done, as
recommended by @shurcooL, since it is emerging as the standard way to do
it in several high profile packages, it mirrors the "unsafe" package
nicely, it is shorter, and users generally seem to prefer it.
However, to avoid breaking existing infrastructure, the disableunsafe
tag is still available and simply is being deprecated.
This commit adds support for compiling spew without the unsafe package.
When compiled without the unsafe package, some of the more advanced
features such as invoking stringers on pointers from non-pointer
variables and unexported struct fields are not available.
By default, spew will be compiled in the limited mode for Google App
Engine since the unsafe package is not available there. Additionally,
spew can be compiled without the unsafe package manually by specifying
the "disableunsafe" build tag.
Finally, a new package-level constant named "UnsafeDisabled" has been
exposed which can be used to programmatically determine if spew was
compiled with access to the unsafe package.
If enabled by flags, try to use methods to stringify map keys and sort on that.
If we can't use primitive sorting and we can't use methods, we can still fall
back on spew itself. If SpewKeys is enabled, use Sprintf("%#v") to generate a
string and sort by that.
This will allow the command to update the package if an old one happens to
be present while still fetching it if it's missing.
Suggested by @shurcooL in #28.