A high-performance CLI tool written in Go that analyzes GitHub repositories concurrently.
I wanted to analyze repository statistics (Stars, Forks) for multiple projects without the latency of sequential API requests. By utilizing Go Routines and Channels, gh-analyzer fetches data in parallel, reducing analysis time for large datasets by ~90%.
- Language: Go (Golang)
- CLI Framework: Cobra
- Concurrency: WaitGroups & Channels
- Testing: Standard
testinglibrary
# Clone the repo
git clone [https://github.com/rukmini-17/gh-analyzer.git](https://github.com/rukmini-17/gh-analyzer.git)
cd gh-analyzer
# Run directly
go run cmd/*.go --user=rukmini-17Running against the go-chi organization demonstrates high-performance concurrency.
Note the analysis time of < 200ms for 22 repositories.
> go run cmd/*.go --user=go-chi
Fetching repos for user: go-chi...
Starting analysis of 22 repositories...
Analyzed 22 repos in 196.522375ms
--- FINAL REPORT ---
REPOSITORY | STARS | FORKS
------------------------------------------------------------
valve | 22 | 3
community-examples | 1 | 1
stampede | 71 | 8
httptracer | 19 | 2
cors | 402 | 38
httprate | 411 | 22
chi | 21270 | 1063
...
(truncated for brevity)
This project includes a unit testing suite to ensure reliability.
go test ./pkg/...
├── cmd/ # Entry point & CLI commands
├── pkg/
│ ├── analyzer/ # Core concurrent logic
│ └── github/ # HTTP Client & API handling
└── .github/ # CI/CD Workflows