How to disable Golang unused import error

前端 未结 8 2077
我寻月下人不归
我寻月下人不归 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:27

    Use if false { ... } to comment out some code. The code inside the braces must be syntactically correct, but can be nonsense code otherwise.

提交回复
热议问题