On Wed, May 1, 2019, 11:44 PM Nitish Saboo wrote:
> Hi Jusitn,
>
> I realised I have value_len field in my arguments.I did this :
>
> func Nitish(key *C.char, value *C.char, value_len C.size_t){
>
> f.WriteString(C.GoString(key)+ ":")
> s := C.GoStringN(value, C.int(value_len))
>
Hi Jusitn,
I realised I have value_len field in my arguments.I did this :
func Nitish(key *C.char, value *C.char, value_len C.size_t){
f.WriteString(C.GoString(key)+ ":")
s := C.GoStringN(value, C.int(value_len))
//fmt.Println(s)
f.WriteString(s)
f.WriteString("\n")
}
Am I doing it correctly?
On Wed, May 1, 2019 at 9:40 PM Nitish Saboo
wrote:
> Actually, this is what is happening:
>
> func Nitish(key *C.char, value *C.char, value_len C.size_t){
>
>f.WriteString(C.GoString(key)+ ":")
>f.WriteString(C.GoString(value))
>f.WriteString("\n")
>
> }
>
> This callback method is
Actually, this is what is happening:
func Nitish(key *C.char, value *C.char, value_len C.size_t){
f.WriteString(C.GoString(key)+ ":")
f.WriteString(C.GoString(value))
f.WriteString("\n")
}
This callback method is getting called from C code multiple times.
I am planning to write the
Hi,
I have this method:
func CallBack(key *C.char, value *C.char, value_len C.size_t){
}
and the *value* parameter in the arguments is containing the given string
'Fp5PpR2roT6uPnte47 image/gif'.
I want to extract only first word from the string.Let me know how can I do
this.
I don't
On Wednesday, May 1, 2019 at 7:06:47 AM UTC+12, Nitish Saboo wrote:
>
> Apologies.I did this 'strings.Split(C.GoString(*C.char),"").
> I am getting 'Incompatible types' compilation error.
>
Are you literally doing this?
strings.Split(C.GoString(*C.char),"")
Something like this should be
Apologies.I did this 'strings.Split(C.GoString(*C.char),"").
I am getting 'Incompatible types' compilation error.
Thanks
On Wed, May 1, 2019 at 12:30 AM Nitish Saboo
wrote:
> Hi,
>
> I want to convert *C.char to array of strings in Go.
> I want to do this because I want the first word from
Hi,
I want to convert *C.char to array of strings in Go.
I want to do this because I want the first word from the string.Strings are
getting appended to *C.char and I want the first word of the string.
I am doing it using 'strings.Split(C.GoString(*C.char))[0]', but it is
giving error.
Can