davecgh / go-spew

Implements a deep pretty printer for Go data structures to aid in debugging
ISC License
5.97k stars 361 forks source link

go-spew fails with withmock utility - UnsafeDisabled redeclared in this block #39

Closed aanm closed 8 years ago

aanm commented 8 years ago
$ withmock go test
ERROR: Failed to install 'github.com/project/db': exit status 2
output:
# github.com/davecgh/go-spew/spew
../../../github.com/davecgh/go-spew/spew/bypasssafe.go:8: UnsafeDisabled redeclared in this block
        previous declaration at ../../../github.com/davecgh/go-spew/spew/bypass.go:11
../../../github.com/davecgh/go-spew/spew/bypasssafe.go:11: unsafeReflectValue redeclared in this block
        previous declaration at ../../../github.com/davecgh/go-spew/spew/bypass.go:57

More info: https://github.com/qur/withmock/issues/50

davecgh commented 8 years ago

My guess based on the error message is that the linked project is incorrectly ignoring the build tags.

bypass.go has // +build !appengine,!disableunsafe bypasssafe.go has // +build appengine disableunsafe.

Those build tags allow different compile time behavior for the constants in question.

davecgh commented 8 years ago

I'm going to close this as it's not a spew issue, rather one with the withmock package. I've commented there accordingly.

aanm commented 8 years ago

@davecgh No problem. Thanks for taking a look at it.