Setup Golang environment

Setup golang env within 10 min.

Alienx
2 min readJul 4, 2022

Hi, I just set up my new golang programming in Windows. so exciting to write this blog.

Software needs:

Golang programming

vs code

Golang extenstions

Phase 1: Install the following in this order

We have the current best version in.exe file on golang official website. During this post go version is go1.18.3.windows-amd64. https://go.dev/dl/

Just Download it.

Execute .exe file

Click Next… Next… Next… Just Install Go Programming file

Phase 2: Add GOPATH

Setting -> About -> Advanced system settings -> environment variables -> PATH -> New -> add Path ex:(C:\Program Files\Go\bin)

Phase 3: Test Golang

Execute Cmd

go -h

Phase 4: Create folder in Gopath/src

Add that folder vs code and init go mod

go mod init example.com/hello

It is just like the nodejs package. we can add go modules in project.

Ex:

Create main.go

package main; func main(){ fmt.Println("Hello"); }

main.go

Terminal:

cd filepath
go run main.go

--

--