-
Notifications
You must be signed in to change notification settings - Fork 94
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
Make gokogiri compile with go 1.6 #93
Conversation
So we only check X == Y where * X is the version we are compiled against * Y is the version we are dynamically linked against on startup
by passing the callback argument (a Go pointer) via global variable. This allows only one SetContent to happen at any time in the program, but works for now.
by passing the WriteBuffer in a global variable
since callbacks in Go1.6 ar not allowed to take Go pointers
Ping, and feedback on this? |
Looks like a reasonable approach to me, but I haven't yet had a chance to test it. |
I can confirm that this resolves the same issue I was having with gokogiri on FreeBSD as well as Linux. |
I've incorporated this into my fork, and it works fine on both 1.5 and 1.6 as far as I can tell. |
I should add that it’s possible to work around the runtime checks in Go 1.6 by using the |
OK, will close it, since everyone interested in a maintained package uses the fork from @jbowtie anyway 😄 |
In Go 1.6 it is basically forbidden to pass a Go pointer to Go functions that are used as callbacks from C.
Fix this by funneling those pointers through global variables.
Fixes #92