How do I fix File is not `goimports`-ed with -local?

Viewed 16

How do I fix this error?

pkg/path/to/file.go:22: File is not `goimports`-ed with -local github.com/some/repositiory (goimports)
        s "github.com/some/repositiory/pkg/somepkg"

If I run goimports -local pkg/path/to/file.go the program just seems to get stuck and nothing happens.

s is the name I use to refer to somepkg, e.g. s.SomeFunc().

1 Answers

You have to run

goimports -w -local github.com/some/repositiory pkg/path/to/file.go
Related