DEV Community

Cover image for Hello World! to Golang setup on windows

Posted on • Updated on

Hello World! to Golang setup on windows

Follow these steps to install and setup your first Go project on windows

  • Download and install Vscode my preffered editor
  • Download and install git bash for windows
  • Download and install Go executable from this link.

  • Set up your GO path by typing this on git bash terminal

    export GOPATH=$HOME/go

This will create a "go" folder in your computers C: directory like so: C:/Users/ProfileName/go

  • Setup a new project inside the go folder structure like so:C:/Users/ProfileName/go/src/, instead of doing this manually, you can use the windows mkdir command to create your project file path like so: mkdir -p $GOPATH/src/
  • Open up your newly created folder on vscode, install the Go extenstion plugin form vscode plugins to enjoy code highlighting and more.

  • Create your first Go file with a .go extention then install All on the prompt that pops up after yourFile.go is created.

You are pretty ready to build your first golang project. If this article helped, please kindly hit the buttons so others can get help. Thanks for viewing.

Discussion (2)

bhupesh profile image
Bhupesh Varshney 👾

Hey hey! Cool post, but just wanted to recommend that you might want to tag it with a few tags to make it easier for folks to discover. 🙂
For e.g in this article you can add go and tutorial tags from the editor

techagentng profile image
kennethnnah Author

Very well appreciated mate, I will do just that