Go supports modules since v1.11+.
Go modules require that GOPATH is empty => unset GOTPATH
Run go mod init {module name}
to create a go.mod file for the current directory.
For example go mod init github.com/brutella/dnssd
creates the following content.