1
- Go support for Protocol Buffers - Google's data interchange format
1
+ # Go support for Protocol Buffers
2
+
3
+ Google's data interchange format.
2
4
Copyright 2010 The Go Authors.
3
5
https://github.com/golang/protobuf
4
6
@@ -20,8 +22,7 @@ To use this software, you must:
20
22
for details or, if you are using gccgo, follow the instructions at
21
23
https://golang.org/doc/install/gccgo
22
24
- Grab the code from the repository and install the proto package.
23
- The simplest way is to run
24
- go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
25
+ The simplest way is to run ` go get -u github.com/golang/protobuf/{proto,protoc-gen-go} ` .
25
26
The compiler plugin, protoc-gen-go, will be installed in $GOBIN,
26
27
defaulting to $GOPATH/bin. It must be in your $PATH for the protocol
27
28
compiler, protoc, to find it.
@@ -102,6 +103,7 @@ for a protocol buffer variable v:
102
103
103
104
Consider file test.proto, containing
104
105
106
+ ``` proto
105
107
package example;
106
108
107
109
enum FOO { X = 17; };
@@ -114,9 +116,11 @@ Consider file test.proto, containing
114
116
required string RequiredField = 5;
115
117
}
116
118
}
119
+ ```
117
120
118
121
To create and play with a Test object from the example package,
119
122
123
+ ``` go
120
124
package main
121
125
122
126
import (
@@ -149,7 +153,7 @@ To create and play with a Test object from the example package,
149
153
}
150
154
// etc.
151
155
}
152
-
156
+ ```
153
157
154
158
## Parameters ##
155
159
0 commit comments