Did you added this tutorial Sebstian?

On Wednesday, 12 September 2012 at 22:39:12 UTC+5:30 Sebastien Binet wrote:

> Kyle Lemons <kev...@google.com> writes:
>
> > On Wed, Sep 12, 2012 at 7:35 AM, Sebastien Binet <seb....@gmail.com
> >wrote:
> >
> >> Kyle,
> >>
> >> > If you use the self describing proto to which you linked, you can get 
> the
> >> > FileDescriptorProto from "protoc -oFILE" and then decoding that file.
> >> You
> >> > can see the source for
> >> > protoc-gen-go<
> >> https://code.google.com/p/goprotobuf/source/browse/#hg/protoc-gen-go>if
> >> > you want to see how the code is generated or re-wrap it.
> >>
> >> thanks, that helped me bootstrap my scaffolding.
> >>
> >> I noticed that once one enables the filedescriptor generation, one gets
> >> this dubious go-import in the xyz.pb.go file:
> >>
> >> import google_protobuf "google/protobuf/descriptor.pb"
> >>
> >
> > That, I believe, is based on the import in your self-describing proto
> > file.
>
> I have this little template:
>
> ``` go
> const pb_pkg_templ = `package {{.Package}};
>
> import "google/protobuf/descriptor.proto";
>
> message {{.Message}} {
> extensions 50000 to max;
> {{with .Fields}}
> {{range .}} {{.Modifier}} {{.Type}} {{.Name}} = {{.Id}}{{.Attr}}; 
> {{end}}
> {{end}}
> }
>
> extend google.protobuf.FieldOptions {
> optional string root_branch = 50002;
> }
>
> message DataHeader {
> // Set of .proto files which define the type.
> required google.protobuf.FileDescriptorSet proto_files = 1;
>
> // number of entries in the payload message
> required int64 NbrEntries = 2;
> }
> `
> ```
>
> which looks like what you pointed at...
>
> -s
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/dc71d15e-3479-48b9-b9be-e39f7b941371n%40googlegroups.com.

Reply via email to