This repository (https://github.com/wilsonmar/golang-samples) contains simple sample code in the Go language.
See https://wilsonmar.github.io/golang
-
It would be an honor for me if you click the Star icon.
-
Fork this to your account because I assume you'll want to make changes.
-
Clone your version of the repo onto your local machine.
-
Install the Go compiler (if you haven't already).
-
Define a global shell variable to your cloned repo.
-
cd into a program's folder.
The hello program contains an enhanced "hello world" example.
-
For testing, build the source into an executable and invoke it in one step:
cd hello go run hello.go cd ..
-
Build the source files into a new executable file (with no file extension), then run the executable:
cd hello go build ./hello cd ..
-
Execute the executable created:
chmod 555 hello ./hello cd ..