DEV Community

Cover image for Hello World! to Golang setup on windows
kennethnnah
kennethnnah

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/github.com/githubUserName/projectFolderName, instead of doing this manually, you can use the windows mkdir command to create your project file path like so: mkdir -p $GOPATH/src/github.com/githubProfileName/projectFolderName.
  • 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.

Top comments (2)

Collapse
 
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

Collapse
 
techagentng profile image
kennethnnah

Very well appreciated mate, I will do just that