Commit Graph

2 Commits

Author SHA1 Message Date
Dave Collins 5215b55f46 Add logic to deal with reflect pkg changes on tip.
This commit adds logic to gracefully the internal reflect.Value flag bit
changes as of golang commit adf9b30e5594 while maintaining support all
the back to Go 1.0.

It accomplishes this by adding code to the init time inspection to
detect the change and set the flag positions accordingly.

While here, also removes a TODO comment since it was already done
previously.
2015-11-05 15:13:17 -06:00
Dave Collins 2df174808e Add support for limited mode without unsafe pkg.
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.
2015-06-19 15:29:34 -05:00