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
Assignees
Milestone

Comments

@crawshaw
Copy link
Contributor

@crawshaw 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

@ianlancetaylor ianlancetaylor commented Jun 4, 2014

Comment 1:

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

@mewmew
Copy link
Contributor

@mewmew 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 added new labels Aug 6, 2014
@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

@gopherbot gopherbot commented Feb 26, 2016

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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.