<pre class="notranslate">$ cat x.go
package main

import "crypto/hmac"

func main() {
    hmac.NewMD5(nil)  // foo
}
$ gofix x.go
x.go:9:2: expected 1 expression
x.go:10:7: expected statement, found ')'
$ 

Don't know whether it is specific to the hmac fix
or a bug in the printer.  Probably the latter, sigh.</pre>
<p dir="auto">by <strong><a href="mailto:mazdak@chango.com">mazdak@chango.com</a></strong>:</p>
<pre class="notranslate">CGO file referring to string.h and using the memcpy function gives the following error:

cannot use (type C.size_t) as type C.ulong in function argument

Sample Code:

package main        

/*
#include &lt;stdlib.h&gt;
#include &lt;string.h&gt;
*/
import "C"

import (
    "unsafe"
    "fmt"
)

func main() {
    var ksiz C.size_t
    ksiz = C.size_t(6)
    k := make([]byte, ksiz)
    kp := C.CString("string")
    C.memcpy(unsafe.Pointer(&amp;k[0]), unsafe.Pointer(kp), C.ulong(ksiz))
    fmt.Println(k)
}

What is the expected output?

Compilation without error. Output:
[115 116 114 105 110 103]

What do you see instead?

# command-line-arguments
./memcpytest.go:17: cannot use ksiz (type C.size_t) as type C.ulong in function argument

Which compiler are you using (5g, 6g, 8g, gccgo)?

CC=clang go build

Which operating system are you using?

ProductName:    Mac OS X
ProductVersion: 10.9
BuildVersion:   13A598
Xcode 5.0.1
Build version 5A2034a

Which version are you using?  (run 'go version')

go version devel +47b2b07a837f Fri Oct 11 16:39:40 2013 -0700 darwin/amd64</pre>