I decided as my computer hobby to start playing with some of the tools in the Project Discovery set. A good portion of these tools seem to be written in the Go language, so let’s also pursue that a little bit. These are my steps to install on my home server.
OK, First let’s install ‘Go’ on our Ubuntu server
sudo apt install golang-go
Now we can check out installation in 2 manners. The first is to ask what version is installed
Run :: go version Output :: go version go1.18.1 linux/amd64
The other option is to write a quick ‘Go’ program and then test that it works.
vim hello.go
Then paste this into our editor window. Don’t forget it is Control + Shift + ‘V’
// Hello Word in Go package main // Import OS and fmt packages import ( "fmt" ) // Let us start func main() { fmt.Println("Hello, world!") // Normal First Program }
Compile and run Go program:
go run hello.go
Or we can build it as a binary:
go build hello.go ./hello Hello, world!