-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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
cmd/go: build panics when passed ="
as build path
#49137
Comments
Note the invocation won't succeed even if the panic is fixed, More minimal panic:
|
go build
crashes given bad invocation="
as build path
Hello, I am trying to fix this. Once double quoted string appears in the import path, build panics. for example:
In "cmd/go/internal/load/pkg.go", // func ImportErrorf
if errStr := err.Error(); !strings.Contains(errStr, path) {
panic(fmt.Sprintf("path %q not in error %q", path, errStr))
}
IMO, this check is quite unreasonable, do we really need it? |
Change https://golang.org/cl/358815 mentions this issue: |
…eady *module.InvalidPathError 1. The call of setError is unnecessary bacause setError do nothing when p.Error is not nil. 2. The call of ImportErrorf may panic in this situation (double quotes appear in the import path). Fixes golang#49137
…odule.InvalidPathError 1. The call of setError is unnecessary bacause setError do nothing when p.Error is not nil. 2. The call of ImportErrorf may panic in this situation (double quotes appear in the import path). Fixes golang#49137
…odule.InvalidPathError 1. The call of setError is unnecessary bacause setError do nothing when p.Error is not nil. 2. The call of ImportErrorf may panic in this situation (double quotes appear in the import path). Fixes golang#49137
Change https://golang.org/cl/372398 mentions this issue: |
…odule.InvalidPathError 1. The call of setError is unnecessary bacause setError do nothing when p.Error is not nil. 2. The call of ImportErrorf may panic in this situation (double quotes appear in the import path). Fixes golang#49137
@bcmills , Is the above CL(https://golang.org/cl/372398) working well for the Issue or else is still there is someother changes required for this. |
Change https://go.dev/cl/452715 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes (1.17.2)
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
run either of these commands in any go project dir
What did you expect to see?
The compilation should succeed, as it does when removing the
''
.What did you see instead?
The text was updated successfully, but these errors were encountered: