swigwin in golang language Example:
/ home/google/swig-2.0.10/Examples/go/class
In the makefile; go tool 6g way to compile third-party packages will not compile

error as follows:

make -f ../../Makefile SRCS='example.c' SWIG='../../../preinst-swig' \
TARGET='example' INTERFACE='example.i' go
make[1]: Entering directory `/home/google/swig-2.0.10/Examples/go/simple'
../../../preinst-swig -go -intgosize 64 `if false ; then echo -gccgo; fi`  example.i
gcc -g -c -fpic -I/usr/include  example.c example_wrap.c 
gcc -shared -I/usr/include  example.o  example_wrap.o  -o example.so
go `if false ; then echo -c -g; elif true ; then echo tool 6g ; fi` -I . example.go
if ! false ; then \
  `if true ; then echo go tool; fi` 6c -I ${GOROOT}/pkg/${GOOS}_${GOARCH} example_gc.c && \
  `if true ; then echo go tool pack; else echo gopack; fi` grc example.a example.6 example_gc.6; \
fi
make[1]: Leaving directory `/home/google/swig-2.0.10/Examples/go/simple'
make -f ../../Makefile TARGET='example' INTERFACE='example.i' go_run
make[1]: Entering directory `/home/google/swig-2.0.10/Examples/go/simple'
*****************************
go tool 6g runme.go
 go tool 6l -r /home/google/go/pkg/linux_amd64:. -o runme runme.6
*****************************
go `if false ; then echo -c -g; elif true ; then echo tool 6g ; fi` runme.go
runme.go:6: can't find import: "code.google.com/p/mahonia"
make[1]: *** [go_run] Error 1
make[1]: Leaving directory `/home/google/swig-2.0.10/Examples/go/simple'
make: *** [check] Error 2

I confirm that the package exists, because I import it in other programs have been compiled through; through the "go build" command mode by the compiler!

code as below:

package main

import (
    "fmt"
    "./example"
    "code.google.com/p/mahonia"   
)

func main() {
    // Call our gcd() function
    x := 42
    y := 105
    g := example.Gcd(x, y)
    fmt.Println("The gcd of", x, "and", y, "is", g)

    // Manipulate the Foo global variable

    // Output its current value
    fmt.Println("Foo =", example.GetFoo())

    // Change its value
    example.SetFoo(3.1415926)

    // See if the change took effect
    fmt.Println("Foo =", example.GetFoo())
}

$ go env                                                                                            [/home/google/swig-2.0.10/Examples/go/simple][21:02:54]
GOARCH="amd64"
GOBIN="/home/google/go/bin"
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/google/0"
GORACE=""
GOROOT="/home/google/go"
GOTOOLDIR="/home/google/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-g -O2 -fPIC -m64 -pthread"
CGO_ENABLED="1"