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 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 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.

Loading

@stemar94
Copy link

@stemar94 stemar94 commented May 4, 2017

also see #14215

Loading

@griesemer
Copy link
Contributor

@griesemer griesemer commented May 5, 2017

@stemar94 Setting the id is good enough.

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented May 5, 2017

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

Loading

@gopherbot gopherbot closed this in 0e75182 May 5, 2017
@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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants