简体   繁体   English

如何修复文件不是使用-local 的`goimports`-ed?

[英]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.如果我运行goimports -local pkg/path/to/file.go程序似乎卡住了,没有任何反应。

s is the name I use to refer to somepkg , eg s.SomeFunc() . s是我用来指代somepkg的名称,例如s.SomeFunc()

You have to run你必须跑

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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