Skip to content

x/tools/cmd/goimports: better understanding of failure to update imports #28935

@theckman

Description

@theckman

I'm using goimports with the go version go1.11.2 darwin/amd64 toolchain. I've hit a case where goimports isn't adding imports when I'd expect it to, and I'm trying to inspect why that is. I am not using modules, and the project is within my GOPATH. The import I'm trying to add is also within the GOPATH, and is actually within the same git repo.

Without the import added, the build failure (via go test .) is:

./case_test.go:13:8: undefined: mockaccounts

Once I manually add the import the tests pass just fine. I'm trying to understand what's causing goimports to be unsure what package to add. I've tried to look for any packages that have functions with similar methods, to no avail.

Does anyone know of a good way to figure out why goimports isn't adding my import.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions