Skip to content

Go tool and library for generating code from the template using interface definition

License

Notifications You must be signed in to change notification settings

fredipevcin/ifacecodegen

Repository files navigation

ifacecodegen

Build Status GoDoc

Go tool and library for generating code from the template using interface definition.

Installation

go get -u github.com/fredipevcin/ifacecodegen/cmd/ifacecodegen

Running ifacecodegen

ifacecodegen -source examples/interface.go -destination -

or

cat examples/interface.go | ifacecodegen

Other options

ifacecodegen -h

Examples

Example templates and interface are located in examples folder.

# example 1
ifacecodegen \
	-source examples/interface.go \
	-template examples/example1.tmpl \
	-destination - \
	-meta service=account \
	-imports "opentracing=github.com/opentracing/opentracing-go,tracinglog=github.com/opentracing/opentracing-go/log"

# example 2
ifacecodegen \
	-source examples/interface.go \
	-template examples/example2.tmpl \
	-destination -

Notes

Inspired by:

About

Go tool and library for generating code from the template using interface definition

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published