Thank you for your interest in contributing to gogpu/ui!
This project follows the Go Community Code of Conduct. Be respectful, constructive, and inclusive.
- Go 1.25+ (latest stable recommended)
- Git for version control
- Familiarity with Go modules and testing
# Clone the repository
git clone https://github.com/gogpu/ui.git
cd ui
# Verify setup
go build ./...
go test ./...Before opening an issue:
- Search existing issues to avoid duplicates
- Check the roadmap in ROADMAP.md
- Provide context: Go version, OS, reproduction steps
Issue templates:
- Bug Report — Unexpected behavior
- Feature Request — New functionality
- Question — Usage clarification
- Fork the repository
- Create a branch from
main:git checkout -b feat/your-feature
- Make changes following our code standards
- Write tests for new functionality
- Run checks:
go fmt ./... go test ./... golangci-lint run - Commit with conventional messages
- Push and open a Pull Request
- Formatting:
gofmt(enforced) - Linting:
golangci-lintwith project config - Naming: Follow Go naming conventions
Use Conventional Commits:
type(scope): description
[optional body]
Types:
| Type | Purpose |
|---|---|
feat |
New feature |
fix |
Bug fix |
docs |
Documentation |
refactor |
Code restructuring |
test |
Adding/updating tests |
chore |
Maintenance tasks |
Examples:
feat(widgets): add Button component
fix(layout): correct Flexbox alignment calculation
docs(readme): update installation instructions
- Unit tests for all public functions
- Coverage target: 70%+
- Table-driven tests preferred
func TestButton_Click(t *testing.T) {
tests := []struct {
name string
input ButtonConfig
wantErr bool
}{
// test cases...
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
// test logic...
})
}
}We follow strict backward compatibility rules (see docs/VERSIONING.md):
-
Functional Options for configurable types:
func NewButton(text string, opts ...ButtonOption) *Button
-
Interface Extension for optional capabilities:
type Focusable interface { Widget Focus() Blur() }
-
Config Structs with zero-value defaults:
type ButtonConfig struct { Text string Disabled bool // zero value = enabled }
| Package | Visibility | Can Change? |
|---|---|---|
core/ |
Public | Stable |
widgets/ |
Public | Stable |
internal/ |
Private | Yes |
experimental/ |
Public | Yes (unstable) |
Before submitting:
- Code compiles without errors
- All tests pass
- New tests added for new functionality
-
go fmtapplied -
golangci-lint runpasses - Documentation updated if needed
- Commit messages follow convention
- No breaking changes to public API (or discussed first)
- Automated checks must pass (CI)
- Maintainer review for code quality
- Discussion for design decisions
- Squash merge to main
Typical review focuses on:
- Correctness and edge cases
- API design and consistency
- Performance implications
- Test coverage
Look for issues labeled good first issue:
- Documentation improvements
- Test coverage additions
- Small bug fixes
For significant changes, open an issue first to discuss:
- New widgets (must implement
gesture.GestureAwarefor pointer interaction) - Layout algorithms
- Theme implementations
- Custom gesture recognizers (implement
gesture.Recognizerinterface) - Accessibility features
- GitHub Issues — Technical questions
- GitHub Discussions — General discussion
- ROADMAP.md — Project direction
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for helping make gogpu/ui better!