<p dir="auto">by <strong>giacomo.tartari</strong>:</p>
<pre class="notranslate">What steps will reproduce the problem?
I don't have an ad hoc example but I stumbled upon the issue while go getting a githhub
repo so the code is there. 
1.
$ go get github.com/jteeuwen/glfw


What is the expected output?

$

What do you see instead?

# github.com/jteeuwen/glfw
ld: duplicate symbol _setCharCB in $WORK/github.com/jteeuwen/glfw/_obj/glfw.cgo2.o and
$WORK/github.com/jteeuwen/glfw/_obj/_cgo_export.o for architecture x86_64
collect2: ld returned 1 exit status

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

Which operating system are you using?

$ uname -rs
Darwin 11.3.0

Which revision are you using?  (hg identify)

$ hg identify
96bd78e7d35e weekly/weekly.2012-02-22

$ go version
go version weekly.2012-02-22 +96bd78e7d35e

Please provide any additional information below.

more details here:
<a href="https://groups.google.com/d/msg/golang-nuts/_HKIFbWX0Co/dwASE-SGPXIJ" rel="nofollow">https://groups.google.com/d/msg/golang-nuts/_HKIFbWX0Co/dwASE-SGPXIJ</a></pre>
<pre class="notranslate">Could we add a shutdown/cleanup mechanism to the testing package?

Background: some tests (notably: integration-style tests) require heavy setup, compiling
things, setting up things on disk, running child processes wired together, etc.

If you just do this once and share it per test, it's unclear when to clean up the /tmp
folder and shut down the processes.

People have resorted to things like TestZZZ for cleanup (which doesn't work well with
-test.run), or z_last_test.go (as seen in net/http), or the hoops jumped through here:

<a href="https://github.com/bradfitz/docker/blob/fuse/vfuse/all_test.go">https://github.com/bradfitz/docker/blob/fuse/vfuse/all_test.go</a>

(Look at release and testsToRun and how it's calculated.)

And also hacks in Google's code, even people so far as to fork the testing package.

Or people run a child process that is responsible for cleanup, once it notices its
parent has died. But that's a lot of work and there are portability concerns.

I know a test could still crash mid-way through, so cleanup on shutdown is still best
effort, but when it's a bunch of big processes and big files in /tmp, that's better than
nothing most the time.

With regard to atexit-ish concerns, I'd propose the shutdown mechanism itself be subject
to the same timeout concerns.  If the shutdown doesn't finish in N seconds, the test
exits with failure.</pre>