How to disable Golang unused import error

前端 未结 8 2054
我寻月下人不归
我寻月下人不归 2020-12-05 03:30

By default, Go treats unused import as error, forcing you to delete the import. I want to know if there exists some hope to change to this behavior, e.g. reducing it to warn

8条回答
  •  渐次进展
    2020-12-05 04:18

    If you are using the fmt package for general printing to console while you develop and test then you may find a better solution in the log package.

提交回复
热议问题