It is very simple to install Google Go using Home Brew on MacOS, just type following command on terminal.
- brew install go
Type following command on Terminal and hit enter to install Iris.
- go get gopkg.in/kataras/iris.v6
Create a working directory using mkdir $GOPATH/src/gowork, you can name anything you want instead of gowork. Now go to your working directory using cd $GOPATH/src/gowork and create a file main.go, file name is up to you.
Open terminal and run following commands one by one.
- mkdir $GOPATH/src/gowork
- cd $GOPATH/src/gowork
- touch main.go
Open main.go file in any editor and put following code in it.
Time to run your server, so just type go run main.go
- go run main.go
Finally open your browser and try to open http://localhost:8080/
Great! you have a very simple server running using Iris.