简体   繁体   中英

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

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 , eg s.SomeFunc() .

You have to run

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM