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: external package is preferred over package level variable #12180

mgenov opened this issue Aug 18, 2015 · 1 comment


Copy link

@mgenov mgenov commented Aug 18, 2015

In db.go

package api

type Stat struct {

type DB struct {
    Stats *Stat

var (
    store = &DB{&Stat{}}

In stats.go

package api

// this line is imported by goimports automatically, where it shouldn't 
import "" 

func takeStats() {
    s := store.Stats

    s = nil

go version go1.5rc1 darwin/amd64
Tools revision: 9f2124f (HEAD)

Copy link

@bradfitz bradfitz commented Oct 23, 2015

Dup of #7463

@bradfitz bradfitz closed this Oct 23, 2015
@golang golang locked and limited conversation to collaborators Oct 24, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

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