gokogiri icon indicating copy to clipboard operation
gokogiri copied to clipboard

Go 1.6: runtime error: cgo argument has Go pointer to Go pointer

Open pebbe opened this issue 10 years ago • 6 comments

I get a panic with Go 1.6. "runtime error: cgo argument has Go pointer to Go pointer" It was working fine with older versions of Go.

pebbe avatar Mar 02 '16 18:03 pebbe

I can repro this issue on go version go1.6 linux/amd64 but not on 1.4.2

erjoalgo avatar Mar 15 '16 06:03 erjoalgo

@erjoalgo https://golang.org/doc/go1.6#cgo

guusvw avatar Mar 16 '16 14:03 guusvw

Per https://github.com/moovweb/gokogiri/pull/93#issuecomment-215582446, switching to import "github.com/jbowtie/gokogiri" worked for me.

afeld avatar May 27 '16 15:05 afeld

yes using "github.com/jbowtie/gokogiri" "github.com/jbowtie/gokogiri/xpath"

solved the problem on Go 1.7 Linux/Amd64

chalithaw avatar Oct 24 '16 04:10 chalithaw

I switched the repo from moovweb to jbowtie and working fine now, thanks

manawasp avatar Nov 05 '16 11:11 manawasp

I see there was a commit in 2018 yet this issue is still not fixed - when I run the example in the readme (on the latest version of Go) there is still a cgo argument has Go pointer to Go pointer error. I can't even run println(doc.String()).

It seems like Gokogiri is currently unusable.

Is the maintainer going to fix this? If I make a PR with a fix, will it be merged?

If not, is the jbowtie fork our only option? If not, can you recommend a more maintained alternative (using Go) for parsing, and more importantly, updating complex XML with XPath?

Thanks, Michael.

mrcook avatar Feb 09 '19 09:02 mrcook