I am facing the same issue.
1) bps := make([]_Ctype_T32_Breakpoint, max)
2) bps := make([]C.struct_T32_Breakpoint, max)
The first method works, the second method will produce type of [0]byte.
So for my project, I use the first method to resolve the error. And when
need to use the pointer, use
to cast to c structure pointer.

Don't understand the difference by using _Ctype_T32_Breakpoint and
C.struct_T32_Breakpoint to refer to same C struct.
On Tuesday, 12 June 2012 08:47:55 UTC+8, Andrew Gallant wrote:

You can unsafe type convert to get the fields you need.
How? I understand how to do it with a Go type:


but in my case, "someGoType" is actually a C type whose translation to
Go is simply *[0]byte. So that


won't do anything. In fact, this is the important bit in my first

var disp *C.struct_wl_display
fmt.Printf("Type: %T\n", disp)

Where the output is "*uint8[0]". The godefs are:

var disp *[0]byte
fmt.Printf("Type: %T\n", disp)

The key here is that I'm already telling Go that 'disp' is a
*C.struct_wl_display. So what am I going to use to convert a *uint8[0]
to a *C.struct_wl_display if *C.struct_wl_display is itself a

Using something like 'type blahblah C.struct_wl_display' doesn't work
either, and is translated to 'type blahblah [0]byte'.
Thanks for the feedback on biogo. You may be interested in boom if you're
doing bioinfo work. Also, please have a look at the API for the exp
packages - they are way too bloated for my liking, but I'm too close to
them to really be sure, so feedback there would be appreciated.
I'm going to be diving back into my research project tomorrow, so
hopefully I'll get chance to take a look at the exp packages. I'll see
if I can come up with any feedback. (The piece I'm interested in now
is your Smith-Waterman alignment implementation, which is beautifully

- Andrew

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
postedJan 23, '13 at 6:09a
activeJan 23, '13 at 6:09a

1 user in discussion

Me Zhuyong: 1 post



site design / logo © 2022 Grokbase