Type-driven code generation for Go
Go Other
Latest commit a964fea Jan 7, 2016 @clipperhouse Merge pull request #94 from drathier/master
Big list of typewriters
Permalink
Failed to load latest commit information.
.gitignore ignore Nov 30, 2014
CHANGELOG.md add stringer to changelog Jan 4, 2015
LICENSE license update Jun 1, 2014
README.md Add link to typewriters.md in readme. Jan 7, 2016
TYPEWRITERS.md Update TYPEWRITERS.md Jan 7, 2016
_gen.go rename slicewriter to slice Nov 29, 2014
add.go dry out custom file creation Nov 26, 2014
add_test.go add to replace custom cmd; new non-global config; clean up tests Nov 24, 2014
config.go refactor arg parsing; add -f force flag Jan 29, 2015
execute.go pass config all the way down to gen'd code; use templates instead of … Feb 7, 2015
get.go add to replace custom cmd; new non-global config; clean up tests Nov 24, 2014
get_test.go fix tests Jan 17, 2015
help.go add watch to usage; other usage changes Dec 14, 2014
help_test.go add to replace custom cmd; new non-global config; clean up tests Nov 24, 2014
imports.go add stringer as built-in typewriter Jan 4, 2015
list.go pass config all the way down to gen'd code; use templates instead of … Feb 7, 2015
list_test.go fatal after first error Feb 7, 2015
main.go pass config all the way down to gen'd code; use templates instead of … Feb 7, 2015
main_test.go refactor arg parsing; add -f force flag Jan 29, 2015
pkg.go add to replace custom cmd; new non-global config; clean up tests Nov 24, 2014
run.go pass config all the way down to gen'd code; use templates instead of … Feb 7, 2015
run_test.go fatal after first error Feb 7, 2015
test.bat shell scripts for testing Jun 22, 2014
test.sh shell scripts for testing Jun 22, 2014
watch.go don't break on error in watch, output instead Jan 18, 2015

README.md

What’s this?

gen is a code-generation tool for Go. It’s intended to offer generics-like functionality on your types. Out of the box, it offers offers LINQ/underscore-inspired methods.

It also offers third-party, runtime extensibility via typewriters.

Introduction and docs…

Changelog

Hey, a video

Typewriters

There is a list of open-source typewriters in TYPEWRITERS.md. Please add your own.

Contributing

There are three big parts of gen.

gen

This repository. The gen package is primarily the command-line interface. Most of the work is done by the typewriter package, and individual typewriters.

typewriter

The typewriter package is where most of the parsing, type evaluation and code generation architecture lives.

typewriters

Typewriters are where templates and logic live for generating code. Here’s set, which will make a lovely Set container for your type. Here’s slice, which provides the built-in LINQ-like functionality. Here’s stringer, a fork of Rob Pike’s tool.

Third-party typewriters are added easily by the end user. You publish them as Go packages for import. Learn more...

We’d love to see typewriter packages for things like strongly-typed JSON serialization, Queues, Pools or other containers. Anything “of T” is a candidate for a typewriter.