Skip to content

Simple Go package with minimal dependencies for parsing dependencies info in from go.mod files

License

Notifications You must be signed in to change notification settings

essentialkaos/depsy

GoReportCard Code Climate Maintainability Codacy Badge
Coverage Status GitHub Actions CI Status GitHub Actions CodeQL Status

InstallationUsage exampleCI StatusContributingLicense


depsy is simple Go package with minimal dependencies for parsing dependencies info in from go.mod files.

FAQ

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.

Installation

Make sure you have a working Go 1.22+ workspace (instructions), then:

go get github.com/essentialkaos/depsy

Usage example

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)
  }
}

CI Status

Branch Status
master CI
develop CI

Contributing

Before contributing to this project please read our Contributing Guidelines.

License

Apache License, Version 2.0