Search code examples
govscode-code-runner

How to avoid tempCodeRunnerFile.go appear in the project


When I execute Run Code in selection mode, there is a temp file called tempCodeRunnerFile.go will appear in the folder. How can I avoid this file appear in the project?

enter image description here


Solution

  • I finally realized that there is a code-runner.ignoreSelection setting can ignore selection to always run entire file. The default is false. I have to turn it on manually in my User Settings. In Go, there is always run entire file.

    {
        "code-runner.ignoreSelection": true
    }