$ glide install
$ go build -o scat ./cmd
Running all tests:
$ tools/test
-
delegator: a(b) calls b, filters its results
In
a.Process()
:// ...do things before ch := b.Process(c) // within current goroutine out := make(chan Res) // after ch go func() { defer close(out) // ...consume ch }() return out
In
a.Finish()
: must callb.Finish()
When either
a.Process()
ora.Finish()
(or both) does nothing else than delegating tob
, thena
should be astruct
that embedsProc
to inherit those methods and benefit from implicit delegation.