That's it. We are done with our program and now save it in a file named hello.go Now Go provides us to compile and run the program in a single command. Fire up the terminal, head in a folder where we saved hello.go and run
Note: For example code shown here refers to go environment in Ubuntu 18.04. Illustration may change a bit depending upon OS being used
gorunhello.go# => Hello World
This should output the > Hello World string. Go also provides us a way to compile this program into executables by using go build
gobuildhello.go# => This should create an executable in same directory# => hello hello.go
Is hello is an executable generated by go build. This can be run in terminal