Contributions are welcome. This document describes the workflow.
- Go 1.25 or newer (matches the
godirective ingo.mod; thetoolchaindirective auto-downloadsgo1.25.3when needed). golangci-lint,govulncheck,shellcheckfor lint gates.- Docker for the optional BMv2 integration tests.
git clone https://github.com/zhh2001/p4runtime-go-controller.git
cd p4runtime-go-controller
make tidy
make lint
make test- Open an issue before starting non-trivial work so the design can be agreed on first.
- Create a branch named
feature/<topic>orfix/<topic>frommain. - Commit using Conventional Commits
(
feat,fix,docs,test,refactor,chore,ci,build,perf). - Sign each commit (
git commit -s) — the project uses the Developer Certificate of Origin. - Open a pull request against
main. Rebase before requesting review. We squash-merge to keep history linear.
gofmt,goimports, andgolangci-lint runmust be clean. CI enforces this.- Every exported symbol has a godoc comment beginning with the symbol name.
- Every blocking exported function takes
ctx context.Contextfirst. - No new package-level mutable state. No side effects inside
init. - New tests use
testify/requirefor fatal assertions andtestify/assertfor soft ones.
-
make lint testpasses locally. - New behavior has tests; public API changes add an entry under
[Unreleased]inCHANGELOG.md. - Exported symbols have godoc; major additions ship with an
Example*function. - Commits are signed and follow Conventional Commits.
See the Code of Conduct for expected behavior in all project spaces.