So, because we don't have/need go.mod, tiny-go based projects need to be placed under GOPATH to avoid the hiccups mentioned above in Vscode (as this ticket) but if the warning dialog is not too annoying, it is still okay to place the project out of GOPATH. I guess this is because I deleted go.mod (but we shouldn't have this anyway to disable go module support). cat /.bashrc export GOPATHHOME/golang export PATH. These are simply environment variables and you can set them. BTW, we should set only GOPATH and PATH (for brew at least), GOROOT integrated inside gos binary. From the Run on menu, under the New targets section, select WSL to add a WSL target. When importing, Go tools looks for the packages inside the GOROOT and GOPATH/src directories. From the Add New Configuration window, select the run/debug configuration that you want to create for running a target. One small hiccups is that Vscode warns You are neither in a module nor in your GOPATH. In the Run/Debug Configuration dialog, click on the toolbar or press Alt Insert. I suggest that you just update to latest stable Go (1.8) and use that convention otherwise you'll need to set the GOPATH variable in your environment. s.The src subdirectory typically contains multiple version control repositories (such as for Git or Mercurial) that track the development of one or more source packages. Going forward I might just start using Docker to build my go projects, as its a bit of a pain, and the documentation and errors are lengthy but dont seem to explain what is wrong in any meaningful and clear way (GOROOT and GOPATH were both setup, but PATH GOROOT and GOPATH all seemed to be a little off). "-tags=iot,arduino,tinygo,gc.conservative,routines " 3 Answers Sorted by: 7 You actually do not need to set the GOPATH environment variable in Go 1.8 it's /go by default. Directory Purpose src: Location of your Go source code i.e. "go.buildTags": "iot,arduino,tinygo,gc.conservative,routines ", "workbench.startupEditor": "newUntitledFile ",
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |