GO Language Chapter: Publishing Open Source Software Packages
Article directory
When we write GO language programs, we will inevitably refer to third-party software packages. So do you know how others publish their own software packages? Don’t worry, this blog will teach you how to do it.
Create a new warehouse
Pull to local
git clone https://github.com/go75/my-package.git
Initialize project
go mod init github.com/go75/my-package.git
Write code
mkdir utils
echo "
package utils
func PrintHello() {
print("Hello")
}" > utils/hello.go
Submit code
git add .
git commit -m "update"
git push
release
Reference package
go get github.com/go75/my-package/utils
So far, you have released your first GO language open source software package.