Building and Using Go Private Packages
· ☕ 3 min read
1. Create a Go Modules Project Create the directory 1 2 mkdir go-test cd go-test Initialize the package 1 2 3 4 5 go mod init gitlab.private.com/shaowenchen/go-test go: creating new go.mod: module gitlab.private.com/shaowenchen/go-test go: to add module requirements and sums: go mod tidy Add the business code main.go
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 package main import ( "github.