Get started with Go Development on Windows
1. Prepare Windows for Golang and Container development
- Install Windows Subsystem for Linux (WSL)
- Setting Up Docker for Windows and WSL to Work Flawlessly
- Sharing SSH keys between Windows and WSL
2. Install and Upgrade Go
3. Install GO Tools for VSCode in WSL
sudo chmod a+w /home/<user>/.cache
4. Remove Go package installed with “go get”
sudo rm -rf $GOPATH/pkg/mod/<pkg_name>
5. Go Module
To run Go codes outside of $GOPATH/src, use Go Modules:
go mod init <module_name>
6. Debug Go in VSCode in WSL
No. You can’t debug Go in WSL. It’s a known limitation of WSL. It is addressed in WSL2.
7. Go tutorials
8. Go limitations
The limitations I don’t like:
- Go build errors are vague
- Go packages management is a mess
- No lambda method
- No generic collection method, like filter, map, sort
- No ?: operator
- No default parameter values for func