<pre class="notranslate">This section is fine and can stay, but it duplicates existing functionality of the
template package. Instead, the program could create a single template, load both the
.html files in one call to ParseFiles, and use ExecuteTemplate instead of its own map.

Would be nice to show users that the caching stuff is done for them if you ask politely.</pre>
<pre class="notranslate">What steps will reproduce the problem?

See attached zip file for reproduction

What is the expected output? What do you see instead?

This sample passes with -compiler gc

 % go test -compiler gc -v  issue/...
=== RUN TestData
--- PASS: TestData (0.00 seconds)
        a_test.go:6: 0 false 
=== RUN TestXData
--- PASS: TestXData (0.00 seconds)
        x_test.go:7: foo &amp;{0 false }
PASS
ok      issue/a 0.005s
?       issue/b [no test files]

But blows up due to duplicate symbols during linking of a/a.test

ucky(~/src) % go test -compiler gccgo -v  issue/...
# testmain
/tmp/go-build896181789/issue/a/_test/issue/liba.a(a.o):(.rodata.__go_tdn_issue_a..issue_a.t+0x0):
multiple definition of `__go_tdn_issue_a..issue_a.t'
/tmp/go-build896181789/issue/liba.a(a.o):(.rodata.__go_tdn_issue_a..issue_a.t+0x0):
first defined here
/tmp/go-build896181789/issue/a/_test/issue/liba.a(a.o): In function `issue_a.TestData':
/home/dfc/src/issue/a/a_test.go:5: multiple definition of `issue_a.Data'
/tmp/go-build896181789/issue/liba.a(a.o):(.bss+0x0): first defined here
/tmp/go-build896181789/issue/a/_test/issue/liba.a(a.o): In function `issue_a..import':
/home/dfc/src/issue/a/a.go:1: multiple definition of `issue_a..import'
/tmp/go-build896181789/issue/liba.a(a.o):/home/dfc/src/issue/a/a.go:1: first defined here
collect2: error: ld returned 1 exit status
FAIL    issue/a [build failed]
?       issue/b [no test files]

Please use labels and text to provide additional information.

Looking at the -x output for go test issue/a

gccgo -o $WORK/issue/a/_test/a.test $WORK/issue/a/_test/main.o -Wl,-( -m64
$WORK/issue/a/_test/issue/liba_test.a $WORK/issue/libb.a $WORK/issue/liba.a
$WORK/issue/a/_test/issue/liba.a -Wl,-)

liba.a is present twice, once in it's normal form, and once in it's extended (due to the
export_test.go) form. 

I am guessing that the first liba.a leaks in due to the transitive import via issue/b.</pre>
<p dir="auto">Attachments:</p>
<ol dir="auto">
<li><a href="https://storage.googleapis.com/go-attachment/7627/0/issue.tar.gz" rel="nofollow">issue.tar.gz</a> (487 bytes)</li>
</ol>