We'd love for you to contribute to our source code! Here are the guidelines we'd like you to follow:
If you find a bug in the source code, you can help us by submitting an issue to our GitHub Repository. Even better you can submit a Pull Request with a fix.
Run the following commands to install the prerequisites needed to complete your pull request submission:
go get -u github.com/golang/lint/golint
go get -u github.com/kisielk/errcheck
go get -u github.com/fzipp/gocyclo
go get -u github.com/gordonklaus/ineffassign
go get -u github.com/client9/misspell/cmd/misspell
Before you submit your pull request consider the following guidelines:
-
Search GitHub for an open or closed Pull Request that relates to your submission. You don't want to duplicate effort.
-
Please sign our Contributor License Agreement (CLA) before sending pull requests. We cannot accept code without this.
-
Please be succinct. Create separate pull requests for separate bug fixes/features.
-
Make your changes in a new git branch:
git checkout -b my-fix-branch master
-
Create your patch, including appropriate test cases.
-
Follow our Coding Rules.
-
Run
make
to build your changes and ensure the build is not broken. -
Run
go fmt
to correct any styling errors in the code -
Run
go test
to run the full test suite. -
Run
make presubmit
to ensure the patch includes healthy go code. -
Push your branch to GitHub:
git push origin my-fix-branch
-
In GitHub, send a pull request to
google:master
. -
If we suggest changes then
-
Make the required updates.
-
Re-run the test suite and build to ensure the code is still healthy.
-
Rebase your branch and force push to your GitHub repository (this will update your Pull Request):
git rebase master -i git push -f
-
That's it! Thank you for your contribution!
After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository:
-
Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
git push origin --delete my-fix-branch
-
Check out the master branch:
git checkout master -f
-
Delete the local branch:
git branch -D my-fix-branch
-
Update your master with the latest upstream version:
git pull --ff upstream master
To ensure consistency throughout the source code, keep these rules in mind as you are working:
- All features or bug fixes must be tested.
- All public API methods must be documented.
Please sign our Contributor License Agreement (CLA) before sending pull requests. For any code changes to be accepted, the CLA must be signed. It's a quick process, we promise!
- For individuals we have a simple click-through form.
- For corporations we'll need you to print, sign and one of scan+email, fax or mail the form.