← Back to list

Go (Golang) setup on Windows

Go is a statically typed, concurrent, and garbage-collected programming language created at Google.

Sumedh Chandanshive · 2025-01-14 06:55 · 0 claps · 0.9 min read
#programming-languages #setup-guide #windows #go #golang-tutorial
Open on Medium ↗
Wiki topics: 💻 · Programming

Go (Golang) setup on Windows

Go is a statically typed, concurrent, and garbage-collected programming language created at Google.

1. Download Go

  1. Visit the official Go website: https://go.dev/dl/
  2. Download the Windows installer (.msi) for your system (e.g., go<version>.windows-amd64.msi).

2. Install Go

  1. Run the downloaded .msi file.
  2. Follow the installation wizard:
  • Accept the license agreement.
  • Choose an installation location (default: C:\Program Files\Go).
  • Click Next to install.

3. Set Environment Variables

The installer automatically sets the environment variables, but you can verify and update them manually:

  1. Open Environment Variables:
  • Right-click on This PCPropertiesAdvanced System SettingsEnvironment Variables.

2. Edit PATH:

  • In System variables, find Path → Click Edit.
  • Ensure C:\Program Files\Go\bin is listed.

3. Set GOPATH:

  • Add a new system variable:
  • Name: GOPATH
  • Value: A directory for your Go workspace (e.g., C:\Users\<YourUsername>\go).

4. Verify Installation

  1. Open Command Prompt or PowerShell.
  2. Check Go version:
go version

You should see the installed Go version, e.g., go version go1.21.0 windows/amd64.

5. Test Go Installation

  1. Create a new directory for your Go project:
mkdir go-hello-world
cd go-hello-world
  1. Create a file named main.go with the following content:
package main

import "fmt"

func main() {
    fmt.Println("Hello, World!")
}
  1. Run the program:
go run main.go

You should see:

Hello, World!

6. Optional: Install an IDE

  • Install an IDE like Visual Studio Code and the Go extension for better development experience.

메타데이터
post_id
fecb1d672f13
slug
go-golang-setup-on-windows-fecb1d672f13
url
https://medium.com/@sum3dh/go-golang-setup-on-windows-fecb1d672f13
canonical_url
https://medium.com/@sum3dh/go-golang-setup-on-windows-fecb1d672f13
author_url
https://medium.com/@sum3dh
status
ok
fetched_at
2026-06-12 07:40:50