Golang Configuration
In our case, we have configured the Golang path in the .bash_profile file using MacOS as following
export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
In the go directory, we have a folder called github.com
Inside the github.com directory, we have our GitHub user directory called oxlb as showing the following screenshot
We will create a new GoLang project under the oxlb directory
Create a Golang Project
Go to your go configuration directory and create a new directory called
GoLangPostgresHelloWorld
Open the terminal and change directory to GoLangPostgresHelloWorld
$ cd GoLangPostgresHelloWorld
Then create a go.mod file using the following file
$ go mod init github.com/oxlb/GoLangPostgresHelloWorld
this will create the go.mod file as shown below
The above file contains the module and version of the GoLang