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

cmd/compile: prints empty canonical import path #11362

Closed
dvyukov opened this issue Jun 23, 2015 · 1 comment
Closed

cmd/compile: prints empty canonical import path #11362

dvyukov opened this issue Jun 23, 2015 · 1 comment
Milestone

Comments

@dvyukov
Copy link
Member

dvyukov commented Jun 23, 2015

On the following program:

package a
import _ "unicode//utf8"

go tool compile prints:

non-canonical import path "unicode//utf8" (should be "")

Go1.4 printed:

non-canonical import path unicode//utf8 (should be unicode/utf8)

The name was lost somewhere during translation. C code contained:

    q = mal(name->len+1);
    memmove(q, name->s, name->len);
    q[name->len] = '\0';
    cleanname(q);
    if(strlen(q) != name->len || memcmp(q, name->s, name->len) != 0) {
        yyerror("non-canonical import path %Z (should be %s)", name, q);
        return 0;
    }

Go code now contains:

    var q string
    _ = q
    if path.Clean(name) != name {
        Yyerror("non-canonical import path %q (should be %q)", name, q)
        return "", false
    }

go version devel +514014c Thu Jun 18 15:54:35 2015 +0200 linux/amd64

@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Jul 11, 2015
@gopherbot
Copy link

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

@minux minux closed this as completed in cb0e98b Oct 8, 2015
@golang golang locked and limited conversation to collaborators Oct 9, 2016
@rsc rsc removed their assignment Jun 23, 2022
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