Skip to content

godescribe is a command line tool for Go source code that parses a directory and generates a list of exported functions signatures in the JSON format.

License

Notifications You must be signed in to change notification settings

fredmenez/godescribe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

godescribe

godescribe is a command line tool for Go source code that parses a directory and generates a list of exported functions signatures in the JSON format.

Go functions names and signature are encoded in a simple JSON model : functionName : functionSignature, eg.:

{
  "GetSensorValue" : {
  	"name"  : "GetSensorValue",
  	"params": [
  			{ "name" : "idx", "type":"uint32" }
  		],
  	"results": [
  			{ "type":"float32" }
  		]
  	}
}

Usage

godescribe dirPath [-outfile=filename.go] [-generator[=filename.go]]

-outfile=filename.go : will create filename.go with a variable named SymbolsJson assigned with the JSON representation string.

-generator : generates a source file named generate_godescribe.go containing a go generate directive to call godescribe for the current package.

-generator=filename.go : same as -generator but will output to the specified filename.

Examples

parse current dir and print to standard output :

godescribe .

parse directory and output results to a Go source file :

godescribe /path/to/package -outfile=symbols.go

Installation

go get github.com/fredmenez/godescribe
go install github.com/fredmenez/godescribe

License

This tool is licensed under the 3-Clause BSD License. See license file.

Status

"Early days" : some changes can be expected based on feedback and new features.

About

godescribe is a command line tool for Go source code that parses a directory and generates a list of exported functions signatures in the JSON format.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages