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: unused named import is mistaken for unnamed import #8149

Closed
crawshaw opened this issue Jun 4, 2014 · 3 comments
Closed

Comments

@crawshaw
Copy link
Member

crawshaw commented Jun 4, 2014

$ goimports <<EOF
package main

import foo "fmt"

func main() { fmt.Println() }
EOF

Prints:

package main

func main() { fmt.Println() }

Low priority, as a second run corrects the import.
@ianlancetaylor
Copy link
Contributor

Comment 1:

Labels changed: added repo-tools, release-none.

@mewmew
Copy link
Contributor

mewmew commented Aug 6, 2014

Comment 2:

I hit a similar issue today, probably related.
1) Navigate to http://play.golang.org/p/rNNcWaiqTN
2) Select "Imports"
3) Click "Format"
4) The resulting source code gives a compile time error when clicking "Run".
1) Navigate to http://play.golang.org/p/anpOWLa77k
2) Select "Imports"
3) Click "Format"
4) The resulting source code works just fine when clicking "Run".

@crawshaw crawshaw self-assigned this Aug 6, 2014
@bradfitz bradfitz removed the new label Dec 18, 2014
@josharian josharian changed the title go.tools/imports: unused named import is mistaken for unnamed import goimports: unused named import is mistaken for unnamed import Apr 3, 2015
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc removed the release-none label Apr 10, 2015
@rsc rsc changed the title goimports: unused named import is mistaken for unnamed import x/tools/cmd/goimports: unused named import is mistaken for unnamed import Apr 14, 2015
@rsc rsc modified the milestones: Unreleased, Unplanned Apr 14, 2015
@rsc rsc removed the repo-tools label Apr 14, 2015
@gopherbot
Copy link

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

@golang golang locked and limited conversation to collaborators Feb 28, 2017
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

6 participants