Installation • Usage example • CI Status • Contributing • License
depsy
is simple Go package with minimal dependencies for parsing dependencies info in from go.mod files.
Q: Why should I use depsy
instead of using runtime/debug.ReadBuildInfo()
for reading already embedded info?
A: First of all — size:
Binary | Size (in bytes) |
---|---|
Original binary | 1819094 |
depsy + embedded go.mod |
1861531 (+ 42,437) |
runtime/debug |
1891541 (+ 72,447) |
Second reason — with debug package, you can't print only direct dependencies.
Make sure you have a working Go 1.22+ workspace (instructions), then:
go get github.com/essentialkaos/depsy
package main
import (
_ "embed"
"fmt"
"github.com/essentialkaos/depsy"
)
//go:embed go.mod
var modules []byte
func main() {
deps := depsy.Extract(modules, false)
for _, dep := range deps {
fmt.Println(dep)
}
}
Branch | Status |
---|---|
master |
|
develop |
Before contributing to this project please read our Contributing Guidelines.