commit | 4e173a59454ffb1d3a75ab749a95e240034c5e46 | [log] [tgz] |
---|---|---|
author | Damien Neil <dneil@google.com> | Fri Aug 02 13:16:57 2019 -0700 |
committer | Damien Neil <dneil@google.com> | Fri Aug 02 21:10:38 2019 +0000 |
tree | 32683678d1ce0ca2d3faa94240870e24ce520570 | |
parent | a6af044c3f0b0dd767f3704601b421c3a2a63717 [diff] |
internal/filedesc: don't close over descopts values It is possible for filedesc to construct a lazy options decoder before the descriptor package has been imported. For example, top-level enum values are eagerly decoded, so a generated proto package can construct a lazy options decoder for an enum value at init time. Don't close over the variables in descopts. Instead, close over a pointer to the variable. Panic with an informative message in the case where options are decoded before the descriptor package has been initialized. Change-Id: I277a57602b083cb7bbf92c8114c50b467e59521f Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/188820 Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
WARNING: This repository is in active development. There are no guarantees about API stability. Breaking changes will occur until a stable release is made and announced.
This repository is for the development of the next major Go implementation of protocol buffers. This library makes breaking API changes relative to the existing Go protobuf library. Of particular note, this API aims to make protobuf reflection a first-class feature of the API and implements the protobuf ecosystem in terms of reflection.
List of relevant design documents:
We appreciate community contributions. See CONTRIBUTING.md.
Issues regarding the new API can be filed at github.com/golang/protobuf. Please use a APIv2:
prefix in the title to make it clear that the issue is regarding the new API work.