Join GitHub today
cmd/cgo: cannot create file using cgo function: file name becomes an invalid encoding #26376
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
changed the title
Cannot create file using cgo function: file name becomes an invalid encoding
Jul 13, 2018
I got a solution form a user on Reddit, here it is what he said:
Since you are passing a string in this example, it will be easier to use .C — which is for passing data as C data types — instead of .Call — which is for passing R objects.
According to the docs on "Foreign Function Interface", a string is passed as char **, so your function will take **C.char:
Using the function like that and the R