Skip to content
Navigation

⚒️ How To Setup GOPATH

Author:Kiyora
Count:114 Character
Reading time:1 Minute

GOPATH is an environment variable used in Go (Golang) programming to specify the workspace directory for Go projects. It defines the root of your Go workspace, which contains the source code for your projects, as well as the compiled binaries and other related files.

Windows (GOPATH)

  1. Open a command prompt by pressing win + r the enter cmd
  2. type at cmd
bash
set GOPATH=c:\Projects

Linux (GOPATH)

  1. Open a terminal by pressing ctrl + alt + t
  2. type at terminal
bash
export GOPATH=$HOME/Projects

Mac (GOPATH)

  1. Open a terminal by pressing command + space then type terminal
  2. type at terminal
bash
export GOPATH=$HOME/Projects