An open API service indexing awesome lists of open source software.

https://github.com/mmpx12/gcat

List or print functions, type, method in go files
https://github.com/mmpx12/gcat

cli go golang parser

Last synced: 5 months ago
JSON representation

List or print functions, type, method in go files

Awesome Lists containing this project

README

          

# GCAT:

![img](.github/screenshots/output.png)

List or print functions, type, method in go files

## USAGE:

```
gcat [OPTION] FILE1 FILE2 ...

options:
-h, --help Show this help
-l, --list-functions List all functions
-p, --print-function FUNC Cat FUNC function
-m, --method TYPE List TYPE method
-t, --list-types List types
-d, --disable-syntax Disable syntax highlighting
-v, --version Print version and exit
```

If no files are passed, check recursivly in current directory for .go files.

**Note:** For pointer receivers * should be escaped and quoted. It can also be ommited:

```sh
$ gcat -m '\*Receiver' main.go
func (r *Receiver) FuncName() string {}

$ gcat -m Receiver main.go
func (r *Receiver) FuncName() string {}
```

### Examples:

```sh
$ gcat --list-functions
$ gcat --print-function main main.go
```

## Install:

```sh
go install github.com/mmpx12/gcat@latest
```

or

```
git clone https://github.com/mmpx12/gcat.git
cd gcat
make
sudo make install
```

Prebuild binaries can be found [here](https://github.com/mmpx12/gcat/releases/latest).