github.com/gocrumb/event (go): Event is a tool to generate observer pattern code for your events. Given the name(s) of event types, this tool will generate the following symbols in a self-contained Go source file:  For example, given this snippet,  running this command  in the same directory will create the file event.go, in package ev, containing the definitions of all the relevant symbols.  You can then listen for events by doing this:  And, emit events by doing this:  Typically this process would be run using go generate, like this:  With no arguments, it processes the package in the current directory. Otherwise, the arguments must name a single directory holding a Go package or a set of Go source files that represent a single Go package.  The -type flag accepts a comma-separated list of types so a single run can generate symbols for multiple types. The default output file is event.go. It can be overridden with the -output flag.  A more complete list of symbols generated for each type is as follows:
Keywords: go|golang|observer-pattern