在Goland中,如果 import 了包,但在代码中没有使用,会自动帮你移除这个包的 引用
有可能是习惯问题,每次写代码都习惯 先import,然后再写调用代码,结果 还没来得及写调用代码,包就被移除了。。。
还好,可以关闭此功能:
add unambiguous imports on the fly(自动添加需要的包)
optimize imports on the fly (自动移除未使用的包)
去掉上面两项
在Goland中,如果 import 了包,但在代码中没有使用,会自动帮你移除这个包的 引用
有可能是习惯问题,每次写代码都习惯 先import,然后再写调用代码,结果 还没来得及写调用代码,包就被移除了。。。
还好,可以关闭此功能:
add unambiguous imports on the fly(自动添加需要的包)
optimize imports on the fly (自动移除未使用的包)
去掉上面两项