英文:
Why vscode removes golang script when doing save
问题
我在保存我的Golang项目时遇到了问题,当我想要导入"fmt"时,保存"fmt"脚本后它就消失了。那么我该如何解决呢?
setting.json(vscode):
{
"workbench.startupEditor" : "newUntitledFile",
"workbench.iconTheme" : "vscode-icons",
"security.workspace.trust.untrustedFiles":"open",
"editor.suggestSelection" : "first",
"vsintelllicode.modify.editor.suggestSelection":"automatically",
"workbench.colorTheme":"Material Theme Ocean",
"vsicons.dontShowNewVersionMessage":"true"
}
英文:
I'm having trouble here when I want to save my golang project, where when I want to import "fmt" then I save the "fmt" script it disappears. then how do i fix it
setting.json (vscode) :
{
"workbench.startupEditor" : "newUntitledFile",
"workbench.iconTheme" : "vscode-icons",
"security.workspace.trust.untrustedFiles": "open",
"editor.suggestSelection" : "first",
"vsintelllicode.modify.editor.suggestSelection":"automatically",
"workbench.colorTheme":"Material Theme Ocean",
"vsicons.dontShowNewVersionMessage":"true"
}
答案1
得分: 2
通常情况下,您不需要手动添加导入语句。您可以编写fmt.Println(1)
,然后查看它是否保留。
英文:
You usually don't need to manually add imports. Write fmt.Println(1)
and see if it keeps it.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论