Development Setup
Get your development environment ready to contribute to Gonzo. This guide covers everything from prerequisites to running your first build.
Prerequisites
Required Software
Go Programming Language:
Version: 1.21 or higher
Download: https://golang.org/dl/
Installation guide: https://golang.org/doc/install
# Verify Go installation
go version
# Should show: go version go1.21.x or higherGit:
Version: 2.0 or higher
Download: https://git-scm.com/downloads
# Verify Git installation
git --versionMake (optional but recommended):
Usually pre-installed on macOS/Linux
Windows: Install via Chocolatey or use Git Bash
Recommended Tools
Code Editor:
VS Code with Go extension
GoLand
Vim/Neovim with vim-go
Any editor with Go support
Terminal:
Modern terminal with good Unicode support
Recommendations: iTerm2, Alacritty, Windows Terminal
Additional Tools:
Getting the Source Code
Fork the Repository
Go to https://github.com/control-theory/gonzo
Click "Fork" button (top right)
This creates your own copy of the repository
Clone Your Fork
Sync with Upstream
Keep your fork up to date:
Project Structure
Understanding the codebase:
Building Gonzo
Quick Build
Manual Build
Development Build
Build for All Platforms
Running Tests
Unit Tests
Race Detection
Coverage Report
Integration Tests
Running Gonzo in Development
Basic Run
With Sample Data
Testing Features
Test file input:
Test stdin:
Test follow mode:
Test OTLP receiver:
Development Workflow
1. Create a Feature Branch
2. Make Changes
3. Test Changes
4. Commit Changes
5. Push to Your Fork
6. Create Pull Request
Go to your fork on GitHub
Click "Compare & pull request"
Fill out PR template
Submit pull request
Code Style
Formatting
Linting
Code Conventions
Naming:
Use camelCase for variables and functions
Use PascalCase for exported names
Keep names short but descriptive
Avoid abbreviations unless common
Comments:
Error Handling:
Debugging
Using Delve
Logging Debug Info
VS Code Debug Configuration
Create .vscode/launch.json:
Common Development Tasks
Adding a New Feature
Plan the feature
Open an issue to discuss
Get feedback from maintainers
Design the implementation
Implement the feature
Create feature branch
Write code following style guide
Add tests for new functionality
Update documentation
Test thoroughly
Unit tests
Integration tests
Manual testing
Submit for review
Create pull request
Address review comments
Wait for approval
Fixing a Bug
Reproduce the bug
Create minimal test case
Document steps to reproduce
Write a failing test
Test should fail before fix
Test should pass after fix
Fix the bug
Make minimal changes
Ensure test passes
Submit fix
Reference issue in commit
Include test in PR
Updating Dependencies
Performance Profiling
CPU Profiling
Memory Profiling
Benchmarking
Troubleshooting Development Issues
Build Fails
Dependency issues:
Version mismatch:
Tests Fail
Race conditions:
Flaky tests:
Run tests multiple times
Check for timing dependencies
Use proper synchronization
IDE Issues
VS Code Go extension problems:
Gopls issues:
Getting Help
Resources
GitHub Issues: Ask questions, report bugs
GitHub Discussions: General discussions
Code Review: Learn from PR feedback
Documentation: Read existing docs thoroughly
Communication
Be respectful: Follow Code of Conduct
Be patient: Maintainers are volunteers
Be clear: Provide context and details
Be helpful: Help others when you can
Next Steps
Now that your development environment is set up:
Read the codebase: Familiarize yourself with the structure
Pick an issue: Look for "good first issue" labels
Make a change: Start with something small
Submit a PR: Get feedback and iterate
Related Documentation:
Contribution Guidelines - Detailed contribution process
Community - How to engage with the community
Architecture Overview - Understanding the codebase
Ready to contribute? Check out open issues labeled "good first issue" to get started!
Last updated