Closed davecgh closed 9 years ago
Your .travis.yml
file currently has:
- go test -v -tags=testcgo ./spew -covermode=count -coverprofile=profile.cov
I suggest adding a second entry to have Travis run tests for "disableunsafe" path as well:
- go test -v -tags=testcgo ./spew -covermode=count -coverprofile=profile.cov
- go test -v -tags=disableunsafe ./spew
Good suggestion. I ran them all locally, but it would be good to have Travis run them as well.
Updated.
Test and it works. safe to merge
Thanks for confirming.
This pull request 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.