title: Generate proto file from golang struct
body: <p>I have a golang struct which contains references to some other structs. Is there an automated way to generate the .proto file from the structs ?</p>
  
  <p>For example:</p>
  
  <pre><code>type A struct {
   a int
   b B
  }
  
  type B struct {
   c []C
  }
  
  type C struct {
   x int
  }
  </code></pre>
  
  <p>should generate:</p>
  
  <p><code>message A, B, C</code> etc. proto3 is preferred. </p>
  
  <p><a href="https://github.com/kubernetes/kubernetes/tree/master/cmd/libs/go2idl" rel="noreferrer">https://github.com/kubernetes/kubernetes/tree/master/cmd/libs/go2idl</a> seems to have something related but is undocumented. Any options ?</p>