Thank you for your interest in contributing!
- Go 1.22+ is required.
- Clone the repo and install dependencies:
git clone https://github.com/tggo/goSentencePiece.git cd goSentencePiece - Set up the Python venv (for generating golden test data):
make venv
- Download the test model and generate golden data:
make golden
- Format code with
gofmt(enforced by CI). - Run
go vetandstaticcheckbefore submitting. - If you have
golangci-lintinstalled, runmake lintfor a full check.
# Unit + golden tests
make test
# Test with coverage
make cover
# Fuzz testing (60s default)
make fuzz- Fork the repository and create a feature branch from
main. - Keep changes focused -- one feature or fix per PR.
- Add or update tests for any changed behavior.
- Run
make testandmake lintand ensure everything passes. - Open a pull request against
mainwith a clear description of the change.
Please open a GitHub issue with steps to reproduce. If the issue involves
incorrect tokenization, include the input text, expected token IDs (from
the Python sentencepiece library), and actual token IDs from this library.