Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
aanm opened this issue Jul 30, 2015 · 1 comment

Comments

@aanm
Copy link

aanm commented Jul 30, 2015

$ 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: davecgh/go-spew#39

@davecgh
Copy link

davecgh commented Jul 31, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants