Skip to content

A utility for getting the dependencies of a specific package in a Go module.

License

Notifications You must be signed in to change notification settings

IzhakJakov/getGoDependencyHierarchy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

getGoDependencyHierarchy

A utility for getting the dependencies of a specific package in a Go module.

Example using Zsh on MacOS

Looking for github.com/spf13/cobra with tag v1.1.1 in grokify/go-aha.
A module is directly using1 the module which is directly under it.

  $ git clone 'https://github.com/grokify/go-aha.git'
 
  $ cd go-aha
 
  $ git checkout v0.2.3

  $ getGoDependencyHierarchy 'github.com/spf13/[email protected]'
            github.com/grokify/go-aha
                       ⬇
       github.com/grokify/[email protected]
                       ⬇
    github.com/wcharczuk/[email protected]+incompatible
                       ⬇
      github.com/blend/[email protected]
                       ⬇
          github.com/spf13/[email protected]

Timeout feature

By default the script will timeout after 16 seconds. In order to change the default time limit (in seconds) set the $GGDH_TIMEOUT env var.

Note: Depending on your shell, this might need to be exported.

Limited support for Incompatible Packages

Scenario Description Support
Chain starts with an incompatible pkg
Incompatible pkgs inside the chain ✔️
Chain ends with an incompatible pkg ✔️

Footnotes

  1. Directly using means the module is directly inside go.mod not just go.sum.

About

A utility for getting the dependencies of a specific package in a Go module.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages