mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-01-01 03:14:16 +00:00
compiler/protogen: add (*GeneratedFile).Unskip
Simplifies some compiler plugins who want to avoid generating empty files. With this API, generated files can be skipped by default, and unskipped when actual code is generated. Change-Id: I941c821646f5c4430a84e08bbad7e021434b1e71 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/232239 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
This commit is contained in:
parent
1f5b6fe645
commit
8525b20428
@ -1109,6 +1109,12 @@ func (g *GeneratedFile) Skip() {
|
||||
g.skip = true
|
||||
}
|
||||
|
||||
// Unskip reverts a previous call to Skip, re-including the generated file in
|
||||
// the plugin output.
|
||||
func (g *GeneratedFile) Unskip() {
|
||||
g.skip = false
|
||||
}
|
||||
|
||||
// Annotate associates a symbol in a generated Go file with a location in a
|
||||
// source .proto file.
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user