- Create Directories
mkdir $HOME/Go
mkdir -p $HOME/Go/src/github.com/user
- Setup your paths
export GOPATH=$HOME/go
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
- Install Go
brew install go
- "go get" the basics
go get golang.org/x/tools/cmd/godoc
- Start here: https://golang.org/doc/code.html at "your first program"
-
Clone this repo using
git clone https://github.com/tokopedia/gosample.git <your-project-name>
. -
cd to and delete the existing git repository by running
rm -rf .git
. -
Initialize a new git repository with
git init
,git add .
andgit commit -m "Initial commit"
. -
Run
go get
to install the dependencies. -
Run
go build
and then ./ to start the local web server. -
Go to
http://localhost:9000
and you should see the app running!