зеркало из https://github.com/golang/protobuf.git
Clarify jsonpb package docs.
This commit is contained in:
Родитель
2402d76f3d
Коммит
5fc2294e65
|
@ -30,12 +30,11 @@
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Package jsonpb provides marshaling/unmarshaling functionality between
|
Package jsonpb provides marshaling and unmarshaling between protocol buffers and JSON.
|
||||||
protocol buffer and JSON objects.
|
It follows the specification at https://developers.google.com/protocol-buffers/docs/proto3#json.
|
||||||
|
|
||||||
Compared to encoding/json, this library:
|
This package produces a different output than the standard "encoding/json" package,
|
||||||
- encodes int64, uint64 as strings
|
which does not operate correctly on protocol buffers.
|
||||||
- optionally encodes enums as integers
|
|
||||||
*/
|
*/
|
||||||
package jsonpb
|
package jsonpb
|
||||||
|
|
||||||
|
|
|
@ -2541,7 +2541,9 @@ func (g *Generator) generateFileDescriptor(file *FileDescriptor) {
|
||||||
w.Close()
|
w.Close()
|
||||||
b = buf.Bytes()
|
b = buf.Bytes()
|
||||||
|
|
||||||
g.P("var fileDescriptor", file.index, " = []byte{")
|
v := fmt.Sprintf("fileDescriptor%d", file.index)
|
||||||
|
g.P()
|
||||||
|
g.P("var ", v, " = []byte{")
|
||||||
g.In()
|
g.In()
|
||||||
g.P("// ", len(b), " bytes of a gzipped FileDescriptorProto")
|
g.P("// ", len(b), " bytes of a gzipped FileDescriptorProto")
|
||||||
for len(b) > 0 {
|
for len(b) > 0 {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче