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
- Host: GitHub
- URL: https://github.com/mmpx12/gcat
- Owner: mmpx12
- Created: 2022-11-27T02:49:09.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-28T00:39:06.000Z (over 3 years ago)
- Last Synced: 2024-06-21T09:38:32.408Z (about 2 years ago)
- Topics: cli, go, golang, parser
- Language: Go
- Homepage:
- Size: 121 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GCAT:

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).