title: GobEncoder for Passing Anonymous Function via RPC
body: <p>I'm trying to build a system that will execute a function on multiple machines, passing the function anonymously via RPC to each worker machine (a la MapReduce) to execute on some subset of data. Gob doesn't support encoding functions, though the <a href="http://golang.org/pkg/encoding/gob/#GobEncoder" rel="nofollow">docs</a> for GobEncoder say that "A type that implements GobEncoder and GobDecoder has complete control over the representation of its data and may therefore contain things such as private fields, channels, and functions, which are not usually transmissible in gob streams" so it seems possible.</p>
  
  <p>Any examples of how this might work? I don't know much about how this encoding/decoding should be done with Gob.</p>