Category Archives: Go

Go – How to Create a Package in Go Language

This blog represents code samples and related concepts on how to create a package or library using GO programming language. Create a HelloWorld Package Save the following code within some file such as hello.go within some package folder such as helloworld within folder $GOPATH/src. Create the package using command such as go install helloworld. Alternatively, go inside the folder helloworld and execute the command, go install. This would lead to creation of *.a file within $GOPATH/pkg folder. Note that command such as go build can be used to compile and check if there are any errors. Pay attention to some of the following: The methods to be exported MUST start …

Continue reading

Posted in Go. Tagged with .

Go – Get Started with Hello World using Go Programming

This blog represents steps required to get started with Go programming language on Linux/Ubuntu. The details can be found on this Golang – Getting Started page. Setup Go & Configure The following instructions can be used to setup Go which includes installation and configuration: Download the appropriate binary release from Go Download Page; In case of Linux, download go1.9.*.tar.gz. Go to the download folder and execute the following command: For the latest version of Go, the above command would look like following: Above command would setup go at the location, /usr/local. Configure path appropriately such that Go can be used to run the programs from anywhere on the system. Set …

Continue reading

Posted in Go. Tagged with .