Why vscode removes golang script when doing save

Issue

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"
}

Solution

You usually don’t need to manually add imports. Write fmt.Println(1) and see if it keeps it.

Answered By – Artur Carvalho

Answer Checked By – Mildred Charles (GoLangFix Admin)

Leave a Reply

Your email address will not be published.