Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[generics] could not find function body in _test packages #39839

kovetskiy opened this issue Jun 24, 2020 · 2 comments

[generics] could not find function body in _test packages #39839

kovetskiy opened this issue Jun 24, 2020 · 2 comments


Copy link

@kovetskiy kovetskiy commented Jun 24, 2020

go version devel +2dc2987ac87 Tue Jun 23 23:41:16 2020 +0000 linux/amd64

working directory: bug2


package bug2_test

import "testing"

func TestT(t *testing.T) {
	x([]int{1}, 1)

func x(type T)(v []T, t T) {


Error: (the same with go2go test)

> go tool go2go build
could not find function body for "x"

The bug doesn't appear if:
a) I change package name to bug2, or
b) I move x function to another package (and export it)

Copy link

@gopherbot gopherbot commented Jun 24, 2020

Change mentions this issue: [dev.go2go] go/go2go: add IDs for test files

Copy link

@ianlancetaylor ianlancetaylor commented Jun 24, 2020

Thanks. This test case, at least, should now be fixed on the dev.go2go branch. I wouldn't be very surprised if there are problems in this area.

gopherbot pushed a commit that referenced this issue Jun 24, 2020
No test because the test harness doesn't support test packages.
(But probably we'll need a better test harness.)

Fixes #39839

Change-Id: I4532b1443dbdd081552ffb78477cbe5039183416
Reviewed-by: Ian Lance Taylor <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.