You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I pass [] bytes variable to curl.Setopt with CURL_POSTFIELDS, I got error "cgo argument has go pointer to go pointer" at 268 line in easy.go:
panic(0x85ee60, 0xc8202200c0)
/usr/local/go/src/runtime/panic.go:464 +0x3e6
github.com/andelf/go-curl._cgoCheckPointer0(0x79f980, 0xc8202200a0, 0xc8202200b0, 0x1, 0x1, 0x7fc858001cc0)
??:0 +0x4d
github.com/andelf/go-curl.(*CURL).Setopt(0xc8201eb2c0, 0x271f, 0x78fb20, 0xc82020cca0, 0x0, 0x0)
/home/ubuntu/go/src/github.com/andelf/go-curl/easy.go:268 +0x2271
I changed the source file and tested as followings:
case []byte:
b := param.([]byte)
ptr := unsafe.Pointer(&b[0])
return newCurlError(C.curl_easy_setopt_string(p, C.CURLoption(opt), (*C.char)(ptr)))
How about my changed code.
The text was updated successfully, but these errors were encountered:
When I pass [] bytes variable to curl.Setopt with CURL_POSTFIELDS, I got error "cgo argument has go pointer to go pointer" at 268 line in easy.go:
panic(0x85ee60, 0xc8202200c0)
/usr/local/go/src/runtime/panic.go:464 +0x3e6
github.com/andelf/go-curl._cgoCheckPointer0(0x79f980, 0xc8202200a0, 0xc8202200b0, 0x1, 0x1, 0x7fc858001cc0)
??:0 +0x4d
github.com/andelf/go-curl.(*CURL).Setopt(0xc8201eb2c0, 0x271f, 0x78fb20, 0xc82020cca0, 0x0, 0x0)
/home/ubuntu/go/src/github.com/andelf/go-curl/easy.go:268 +0x2271
I changed the source file and tested as followings:
case []byte:
b := param.([]byte)
ptr := unsafe.Pointer(&b[0])
return newCurlError(C.curl_easy_setopt_string(p, C.CURLoption(opt), (*C.char)(ptr)))
How about my changed code.
The text was updated successfully, but these errors were encountered: