Know the cost before you go get
A CLI tool that analyzes Go module dependencies and shows their impact before installation.
When you run go get github.com/gin-gonic/gin, you don't know:
- How big is gin itself?
- What dependencies does it pull in?
- Total download size?
go-bloat answers these questions before you install.
| Status | Feature |
|---|---|
| ✅ | Fetch latest version from Go proxy |
| ✅ | List all transitive dependencies |
| ✅ | CI/CD with GitHub Actions |
| ✅ | Cross-platform builds (Linux, macOS, Windows) |
| 🚧 | Size calculation per dependency |
| 🚧 | Compare alternative packages |
| 🚧 | Suggest lighter alternatives |
go run github.com/apollo87z/go-bloat/cmd@latest analyze <module>go install github.com/apollo87z/go-bloat/cmd@latest
go-bloat analyze <module>Download pre-built binaries from Releases
# Analyze a module
go run cmd/main.go analyze github.com/gin-gonic/ginOutput:
🔍 go-bloat - Know the cost before you go get
📦 Analyzing: github.com/gin-gonic/gin
Fetching: https://proxy.golang.org/github.com/gin-gonic/gin/@latest
Found version: v1.9.1
Fetching dependencies from: https://proxy.golang.org/github.com/gin-gonic/gin/@v/v1.9.1.mod
Found 10 dependencies
Latest version: v1.9.1
Dependencies (10):
1. github.com/bytedance/sonic
2. github.com/gabriel-vasile/mimetype
3. github.com/gin-contrib/sse
4. github.com/go-playground/validator/v10
5. github.com/goccy/go-json
6. github.com/json-iterator/go
7. github.com/mattn/go-isatty
8. github.com/pelletier/go-toml/v2
9. github.com/ugorji/go/codec
10. google.golang.org/protobuf
✅ Analysis complete!
go-bloat analyze github.com/gin-gonic/gin
go-bloat analyze github.com/gorilla/mux
go-bloat analyze github.com/labstack/echo/v4See how many transitive dependencies a package pulls in before adding it to your project.
Discover what your dependencies depend on - useful for security audits and license compliance.
go-bloat/
├── cmd/
│ ├── main.go # CLI entry point
│ └── main_test.go # Tests
├── pkg/
│ └── registry/
│ ├── types.go # Data structures
│ └── proxy.go # Go proxy client
├── .github/
│ └── workflows/
│ ├── test.yml # Test pipeline
│ └── build.yml # Build pipeline
├── go.mod
└── README.md
git clone https://github.com/apollo87z/go-bloat.git
cd go-bloat
go run cmd/main.go analyze <module>go test ./...- Calculate actual download size per dependency
- Show dependency tree visualization
- Compare multiple packages side-by-side
- Suggest lighter alternatives
- Cache results for faster lookups
- REST API endpoint
- Support for private modules
Contributions welcome! Open an issue or submit a PR.
MIT License - see LICENSE for details.
- SAT Dependency Resolver - Universal dependency resolver using SAT solvers (Python)
Built by Shehan Horadagoda
⭐ Star this repo if you find it useful!