Thanks for your interest in the Presto Go client library. We welcome contributions from everyone.
- Fork and clone the repository
- Ensure you have Go 1.26 or newer installed
- Install required tools:
go install honnef.co/go/tools/cmd/staticcheck@latest go install golang.org/x/vuln/cmd/govulncheck@latest
- Run
go mod downloadto fetch dependencies - Run
go test ./... -race -count=1to verify everything works
This repo contains three separate Go modules. The auth modules are separate to avoid forcing heavy dependencies (gokrb5, oauth2) on all consumers.
github.com/prestodb/presto-go-client/v2 # root module
├── prestoauth/kerberos/ # separate module (gokrb5 dep)
└── prestoauth/oauth2/ # separate module (x/oauth2 dep)
Submodules use replace directives for local development. When working on a submodule, cd into it before running commands.
# Root module
go test ./... -race -count=1
# Submodules (must cd first)
cd prestoauth/kerberos && go test ./... -race -count=1
cd prestoauth/oauth2 && go test ./... -race -count=1All code must pass these checks before submitting a PR:
gofmt -w .
go vet ./...
staticcheck ./...govulncheck ./...CI enforces an 80% coverage threshold on the root module:
go test ./... -coverprofile=coverage.out -covermode=atomic \
-coverpkg=github.com/prestodb/presto-go-client/v2,github.com/prestodb/presto-go-client/v2/utils
go tool cover -func=coverage.out | grep totalUse the provided script to update all go.mod files and the CI workflow at once:
./scripts/bump-go-version.sh 1.26.1After running the script, follow the printed instructions to run go mod tidy, tests, and lint on all modules. If you upgraded to a new major Go release, rebuild your tools (staticcheck, govulncheck) with go install so they match.
Run the full check suite:
gofmt -w .
go mod tidy
go vet ./...
staticcheck ./...
go test ./... -race -count=1
govulncheck ./...Repeat for each submodule you changed.
We follow the Conventional Commits specification. CI enforces this on all PR commits.
Format:
<type>: <description>
Types:
feat— new feature or functionalityfix— bug fixdocs— documentation only changesrefactor— code refactoring without changing functionalityperf— performance improvementstest— adding or modifying testsbuild— build system or dependency changesci— CI/CD configuration changeschore— maintenance tasksrevert— reverting a previous commitstyle— formatting, whitespace (no logic changes)
Examples:
feat: add support for INTERVAL YEAR TO MONTH typefix: handle nil pointer in query stats parsingtest: add coverage for TLS DSN parametersdocs: update README authentication section
- Keep PRs focused on a single topic
- Include tests for all bug fixes and new features
- Ensure all checks pass before requesting review
- Explain what and why in the PR description, not how
To accept your pull request, you must submit a CLA. You only need to do this once for any repository in the prestodb organization. When you submit a pull request for the first time, the communitybridge-easycla bot will notify you if you haven't signed and provide a link. If you are contributing on behalf of a company, let the person who manages your corporate CLA whitelist know they will be receiving a request from you.
Please refer to our Code of Conduct.
By contributing to this project, you agree that your contributions will be licensed under the Apache License Version 2.0.