Closed dmitshur closed 9 years ago
Thanks for the PR.
I believe there are a couple more things that need to be considered here before it's ready however:
unsafeReflectValue
the returned reflect.Value
is addressable and therefore can have .Addr
and .Interface
on it. Since the stub won't actually make it addressable, those calls will panic. Thus, there needs to be some type of constant that is set differently when running in "unsafe" mode versus not and the code would need to be updated to respect that constant accordingly.unsafeReflectValue
. The output when that is a stub is going to be different which will result in failing tests. The tests will need to updated to handle both variants accordingly, likely by using the same constant mechanism previously mentioned.Makes sense. It seems like you will need to take care of significantly more things to resolve that issue than this PR offers. I'll close it. As I said in the description, I made it just in case it's helpful, and it took me a minute to do it because I backported my go-goon/bypass
change. I did not realize you'll have extra considerations, but that makes sense.
np. Thanks for the PR though. It'll still be useful even if a few more things have to be considered.
This allows the package to build and operate in a limited fashion on Google App Engine, where "unsafe" package is not available.
Closes #35.
This PR is simply for your convenience @davecgh, feel free to make use of it or close it depending on your plan to handle #35.