For you to write Go code on your computer, you need to set up a Go workspace. A Go workspace is a folder where you will write your Go code. Setting up a Go workspace is relatively simple. Here is what you will need to do:
- First, make sure that you have Go installed. As we mentioned earlier, you can download and install Go by going to https://golang.org/dl/.
- After installing Go, create a new folder in your computer for Go's workspace. Mine is called GoProjects.
- Inside your Go workspace folder, you will have to create three main folders: src, pkg, and bin. It is very important to create folders with these exact names inside your Go workspace folder. Here is why these three folders are important: