How to set up development environment of GoLang?

This article is about to set up development environment for GoLang.

Instructions

  1. Download Go and install

  2. Update your Visual Studio Code to the latest edition or install the latest edition.

  3. Install the Go extension for vscode from here.

  4. Open your Go project in vscode.

  5. Click install/install all if any popup message shown. vscode will automatically download all necessary dependencies.

  6. Navigate to your project folder and check for a file named 'go.mod'.

  7. If 'go.mod' is not found then use go mod init command from Powershell.

    1. i.e: go mod init zachai.xyz/verify-api

    2. go.mod file will be created with reference to all used dependencies.

  8. use go get -u github.com/golang/dep/cmd/dep to download dependencies.

  9. use go build to build your project.

  10. and run your project.

  11. Happy coding