Configure go-task in VSC

problem description

configuration in go-task

{
     "label": "Go-Build",
     "type": "shell",
     "command": "go",
     "args": [
                "build",
                "${file}"
            ],
     "group":{
                "kind":"build",
                "isDefault":true
            }
}  

the platform version of the problem and what methods you have tried

The problem with

is that the package can be found when debugger, and the launch.json in the project will be found according to go.inferGoPath, but why can"t Bonnie be found in the set task?

think of yourself

taskshell,,go.inferGoPathGOPATH.

solution

  1. set the GOPATH path to the current workSpace in task. I don"t know why the following has no effect
    "options": {

     "env": {
         "${GOPATH}":"${workSpace}" 
     }

    }

  2. set the GOPATH environment variable to two paths: the first is the workSpace in the current VSC, so that when go-get or a third-party library is imported, it will be downloaded to the current workSpace, and the second is the default path: ~ / go; at the same time, set go.toolsGoPath to ~ / path-to-tools so that goTools will not be downloaded repeatedly

do you have a better way, or a way?

https://cloud.tencent.com/developer/article/1339642

Jul.08,2022
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb0597-22cb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb0597-22cb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?