blob: 9ea142067f2951cc8fa1b56f4bb278ae351e237c [file] [log] [blame]
Damien Neil220c2022018-08-15 11:24:18 -07001// Copyright 2018 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// The protoc-gen-go binary is a protoc plugin to generate a Go protocol
6// buffer package.
7package main
8
9import (
10 "strings"
11
12 "google.golang.org/proto/protogen"
13)
14
15func main() {
16 protogen.Run(func(gen *protogen.Plugin) error {
17 for _, f := range gen.Files {
18 if !f.Generate {
19 continue
20 }
21 genFile(gen, f)
22 }
23 return nil
24 })
25}
26
27func genFile(gen *protogen.Plugin, f *protogen.File) {
28 g := gen.NewGeneratedFile(strings.TrimSuffix(f.Desc.GetName(), ".proto") + ".pb.go")
29 g.P("// Code generated by protoc-gen-go. DO NOT EDIT.")
30 g.P("// source: ", f.Desc.GetName())
31 g.P()
32 g.P("package TODO")
33
34 // TODO: Everything.
35}