showdeps

show Go package dependencies

  • 所有者: rogpeppe/showdeps
  • 平台:
  • 許可證: GNU General Public License v2.0
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Showdeps - an opinionated tool for inspecting Go package dependencies

Showdeps starts where go list -f leaves off. It's useful for exploring
dependency graphs of Go programs.

By default, showdeps just shows the packages imported by the packages
named on the command line. It doesn't show those packages themselves,
it doesn't recursively visit all dependencies, and it doesn't show
dependencies in the standard library.

You can specify additional flags to show all of those things:

The -a flag will show all dependencies recursively. By default
this will include testing dependencies but only those of the packages
specifically mentioned. This keeps the dependency graph from becoming
too unwieldy due the testing dependencies in external repositories that
you really don't care about.

The -stdlib flag will include dependencies from the standard
library. These are excluded by default because dependencies on the
standard library are rarely a problem.

The -T flag causes test dependencies to be omitted. With -T
specified, you'll see the exact dependencies of the package without
pollution from test-related code.

There are other flags that provide more insight into the details of
the dependencies.

The -from flag shows why each dependency is included by printing,
along with each package, the list of packages that depend on it.

The -why flag can be used to explore just why a particular package has
been included in the result. By default, it shows a single dependency chain
(a sequence of package names that import each other) from
the listed packages to any package matched by the =why argument.
If the -a flag is provided, it instead prints all packages
that are part of any of those chains in -from style.

Finally, the -f flag causes all the Go source file names to be printed.
Since this is usually for whole-program greps or analysis, this also
includes the source files in the packages specified on the command line.

Examples:

Print the immediate dependencies of the package
in the current directory:

$ showdeps

Print the import pages of all the packages used directly and indirectly by net/http.

$ showdeps -a -stdlib -T net/http

Show a line count of all the packages underneath
the current directory and their dependencies.

$ showdeps -a -f ./..., xargs cat, wc -l

Find out one reason why net/http indirectly imports crypto/x509/pkix:

$ showdeps -T  -why crypto/x509/pkix net/http
net/http crypto/tls crypto/x509 crypto/x509/pkix

主要指標

概覽
名稱與所有者rogpeppe/showdeps
主編程語言Go
編程語言Go (語言數: 1)
平台
許可證GNU General Public License v2.0
所有者活动
創建於2014-09-15 13:47:56
推送於2018-07-19 11:05:54
最后一次提交2018-07-19 12:05:53
發布數0
用户参与
星數51
關注者數5
派生數1
提交數16
已啟用問題?
問題數0
打開的問題數0
拉請求數2
打開的拉請求數0
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?