<p dir="auto">by <strong>piotrnar</strong>:</p>
<pre class="notranslate">What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. Extract the testcgo folder to %GOPATH%\src\testcgo
2. Extract test.go wherever you want
3. Execute "go build -race test.go"

---------------------
What is the expected output?
It should build an executable.

---------------------
What do you see instead?
It does not build executable, printing such an error: 
C:\Temp\go-build267462183/testcgo.a(_all.o): duplicate symbol reference: ___chkstk_ms in
both runtime/race(.text) and testcgo(.text)

---------------------
Which operating system are you using?
Windows 7 64-bit

---------------------
Which version are you using?  (run 'go version')
go version go1.1.2 windows/amd64</pre>
<p dir="auto">Attachments:</p>
<ol dir="auto">
<li><a href="https://storage.googleapis.com/go-attachment/6305/0/cgoerr.zip" rel="nofollow">cgoerr.zip</a> (284786 bytes)</li>
</ol>
<pre class="notranslate">init.go:

package main

import "pckg_a"
import "pckg_b"

func main() {
    pckg_a.New()
    pckg_b.New()

src/pckg_a/test.go:

package pckg_a

import "pckg_b"

func New() string {
    return pckg_b.New()

src/pckg_b/test.go:

package pckg_b

import "pckg_a"

func New() string {
    return pckg_a.New()


In the directory containing init.go:

GOPATH=`pwd` go build

reports

init.go:3:8: import cycle not allowed

The bug is that it does not actually report the import cycle.

If I apply this patch to cmd/go/pkg.go:

--- a/src/cmd/go/pkg.go Sun Aug 11 13:05:51 2013 +0400
+++ b/src/cmd/go/pkg.go Mon Aug 26 09:42:19 2013 -0700
@@ -252,7 +252,7 @@
        bp.BinDir = gobin
    }
    p.load(stk, bp, err)
-   if p.Error != nil &amp;&amp; len(importPos) &gt; 0 {
+   if p.Error != nil &amp;&amp; len(importPos) &gt; 0 &amp;&amp; p.Error.Err !=
"import cycle not allowed" {
        pos := importPos[0]
        pos.Filename = shortPath(pos.Filename)
        p.Error.Pos = pos.String()

Then the complete import cycle is reported:

package .
    imports pckg_a
    imports pckg_b
    imports pckg_a: import cycle not allowed


Recording this issue in the hopes of producing a more sensible patch.</pre>