gosrcinfo

command module
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2021 License: MIT Imports: 6 Imported by: 0

README

gosrcinfo allows to collect information about the source code of Go projects. It prints to stdout the lists of Go files, packages, types and methods. gosrcinfo uses only standard library.

Build

git clone git@github.com:AndreyAdnreyev/gosrcinfo.git
cd gosrsinfo
go build
./gosrcinfo
./gosrcinfo -help

Usage

  1. List all Go files in the current directory and sub directories
./gosrcinfo
  1. List all packages in the files of the current directory and sub directories
./gosrcinfo -lsP
  1. List all types in files of the specified directory and its sub directories
./gosrcinfo -path=. -lsT
The list of all types in all files

  1 : type MapData map[string][]string : ./data.go
  1. List all types in the package
./gosrcinfo -lsT -pkg=package_name
  1. List all methods of a specified type
./gosrcinfo -type=MapData -lsM
The list of all methods of type MapData

  1 : func (d MapData) print()  : ./data.go
  2 : func (d MapData) add(in []string, file string)  : ./data.go
  1. List all functions
./gosrcinfo -lsF
  1 : func getGoFiles(path string) ([]string, error)  : ./files.go
  2 : func TestGetGoFiles(t *testing.T)  : ./files_test.go
  3 : func getData(files []string, pkg, search string) (MapData, error)  : ./main.go
  4 : func readData(path, pkg, search string) ([]string, error)  : ./main.go
  5 : func printHelp()  : ./data.go
  6 : func printSlice(input []string)  : ./data.go
  7 : func setupTestGetGoFiles(tb testing.TB, path string) (func(tb testing.TB), error)  : ./files_test.go
  8 : func main()  : ./main.go
  9 : func listAllFiles(path string)  : ./main.go
 10 : func listData(path, pkg, search string)  : ./main.go
 11 : func NewMapData() MapData  : ./data.go
  1. List all functions in a package
./gosrcinfo -lsF -pkg=package_name

Licensing

See LICENSE for more details.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL