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

go/types: missing err message in "could not import" error #20230

Closed
josharian opened this issue May 4, 2017 · 4 comments
Closed

go/types: missing err message in "could not import" error #20230

josharian opened this issue May 4, 2017 · 4 comments

Comments

@josharian
Copy link
Contributor

josharian commented May 4, 2017

Using importer.Default, run go/types on:

package p

import "t"

Result:

	x.go:3:8: could not import t (can't find import: )

Seems like there is something missing before the closing parens.

Discovered (by accident) by go-fuzz.

@griesemer

@stemar94
Copy link

stemar94 commented May 4, 2017

In go/internal/gcimporter/gcimporter.go line 46 function FindPkg returns before setting the return variable id string, which is later used for the error message.
Thats what I found out, but I don't know, what the correct behavior or output should be. Maybe it is as simple as setting id before exiting.

@stemar94
Copy link

stemar94 commented May 4, 2017

also see #14215

@griesemer
Copy link
Contributor

@stemar94 Setting the id is good enough.

@gopherbot
Copy link

CL https://golang.org/cl/42870 mentions this issue.

@golang golang locked and limited conversation to collaborators May 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants