andrewchambers / gosrcs

Print all source code for a given go package or module.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gosrcs

gosrcs is a tool to print all the source code a given go package depends on.

The original motivation of this tool is to integrate go builds into other build systems with proper dependency tracking, but the only real limit is your imagination.

Usage

Usage: gosrcs [options] <module dir>

Options:
  -deps
        Print source paths of dependencies.
  -module-required
        Only print source paths with corresponding go modules (ignores the stdlib by default). (default true)
  -pattern string
        Go package pattern to gather source paths for. (default ".")
  -relative
        Print source paths relative to the working directory.

Example

$ gosrcs ~/src/gosrcs
/home/ac/src/gosrcs/go.mod
/home/ac/src/gosrcs/main.go
$ cd ~/src/gosrcs
$ gosrcs -deps -relative
...
../../go/pkg/mod/golang.org/x/tools@v0.1.6/go/packages/visit.go
...
go.mod
main.go

About

Print all source code for a given go package or module.


Languages

Language:Go 100.0%