qur / withmock

Automatic Go package mock generation tool
Other
71 stars 9 forks source link

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

Open aanm opened 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/davecgh/go-spew/issues/39

davecgh commented 8 years ago

I commented on the linked issue, but I'll post it here too for visibility.

My guess based on the error message is that this project is incorrectly ignoring the build tags. Spew uses build tags to allow different compile time behavior for the constants in question.

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

The error message clearly shows that both files are incorrectly being compiled.