The following section refers to publishing package(s) to https://pkg.go.dev.
- See GO's Publishing a Module for additional details.
- Establish a
LICENSE
to the project. - Ensure dependencies are updated.
go mod tidy
- Sync the working tree's
HEAD
with its remote.git add . git commit --message "<commit-msg>" git push --set-upstream origin main
- Assign a tag and push.
git tag "v$(head VERSION)" && git push origin "v$(head VERSION)"
- Make the module available, publicly.
GOPROXY=proxy.golang.org go list -mutex "github.com/x-ethr/example@v$(head VERSION)"
Adding the package to pkg.go.dev
may need to be requested. Navigate to the mirror's expected url, and follow
instructions for requesting the addition.
Upon successful request, a message should be displayed:
We're still working on “github.com/x-ethr/example”. Check back in a few minutes!
For any other issues, consult the official documentation.
The following project makes use of pre-commit
for local-development git-hooks
. These hooks are useful
in cases such as preventing secrets from getting pushed into version-control.
See the .pre-commit-config.yaml
for implementation specifics.
- Install pre-commit from https://pre-commit.com/#install.
- Auto-update the config to the latest repos' versions by executing
pre-commit autoupdate
. - Install with
pre-commit install
.
Update the configuration's upstreams
pre-commit autoupdate
Install pre-commit
to local instance
pre-commit install
Tool godoc
is required to render the documentation, which includes examples.
- See
doc.go
for code-specific package documentation.
Installation Steps:
- Install
godoc
.go install golang.org/x/tools/cmd/godoc@latest
- Backup shell profile and update
PATH
.cp ~/.zshrc ~/.zshrc.bak printf "export PATH=\"\${PATH}:%s\"\n" "$(go env --json | jq -r ".GOPATH")/bin" >> ~/.zshrc source ~/.zshrc
- Start the
godoc
server.godoc -http=:6060
- Open the webpage.
open "http://localhost:6060/pkg/"