To install and run GO Programming Language :
INSTALLATION PROCEDURE:
- Open Terminal
(Ctrl+Alt+T)
- Check for updates
$ sudo apt-get update
- Add the following line (to install ver 1.8)
$ sudo apt-get install golang-1.8-go
- Check if its installed properly or not
$ go version
This lets you know the current version of go you are running.
- You have successfully installed the GO lang in your system.
There are three ways to run GO Code.
- Using a Terminal
i) Create a file with .go extension.
1. Open terminal and type
$ notepadqq hello.go
2. Try the following code
package main
import "fmt"
func main() {
fmt.Println("HELLO WORLD")
}
ii) Build and Run the file with the following commands.
3.
go run hello.go
This displays the following output.
"HELLO WORLD"
2. Using Online Editor
Visit the official link :
https://play.golang.org/
2. Using IDE
Download and install
LITEIDE.(https://sourceforge.net/projects/liteide/)
Copy the hello.go code
Run using CTRL + R. You will see the output.