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

x/tools/cmd/goimports: mishandles named imports used under original name #11259

Closed
josharian opened this issue Jun 17, 2015 · 2 comments
Closed

x/tools/cmd/goimports: mishandles named imports used under original name #11259

josharian opened this issue Jun 17, 2015 · 2 comments
Assignees
Milestone

Comments

@josharian
Copy link
Contributor

@josharian josharian commented Jun 17, 2015

http://play.golang.org/p/gmQEUKYxrG

package main

import (
    "fmt"
    t "time"
)

func main() {
    fmt.Println("Hello, playground")
    time.Sleep(time.Second)
}

Run through imports, results in:

package main

import "fmt"

func main() {
    fmt.Println("Hello, playground")
    time.Sleep(time.Second)
}

Note that the named time import has been removed but not reinserted without the name. The resulting code does not compile. Running through goimports again fixes things.

Low priority corner case.

@josharian josharian added this to the Unreleased milestone Jun 17, 2015
@hectorj
Copy link

@hectorj hectorj commented Nov 23, 2015

Seems like a duplicate of #8149, no?

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Nov 23, 2015

Yeah, looks like it.

@bradfitz bradfitz closed this Nov 23, 2015
@golang golang locked and limited conversation to collaborators Nov 27, 2016
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
You can’t perform that action at this time.