Tag 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 …