@@ -28,28 +28,23 @@ There are no insertion points in the plugin.
28
28
29
29
To install this code:
30
30
31
- The simplest way is to run goinstall .
31
+ The simplest way is to run go get .
32
32
33
33
# Grab the code from the repository and install the proto package.
34
- goinstall code.google.com/p/goprotobuf/proto
35
-
36
- # Compile and install the compiler plugin
37
- cd $GOROOT/src/pkg/code.google.com/p/goprotobuf/compiler
38
- make install
34
+ go get -u code.google.com/p/goprotobuf/{proto,protoc-gen-go}
39
35
40
36
The compiler plugin, protoc-gen-go, will be installed in $GOBIN,
41
- defaulting to $HOME /bin. It must be in your $PATH for the protocol
37
+ defaulting to $GOPATH /bin. It must be in your $PATH for the protocol
42
38
compiler, protoc, to find it.
43
39
44
40
Once the software is installed, there are two steps to using it.
45
41
First you must compile the protocol buffer definitions and then import
46
42
them, with the support library, into your program.
47
43
48
- To compile the protocol buffer definition, write a Makefile in the
49
- style shown in the comment in the file Make.protobuf. If your Makefile
50
- includes Make.protobuf, the rest should follow automatically. The
51
- generated code can be compiled separately or as part of a normal Go
52
- package.
44
+ To compile the protocol buffer definition, run protoc with the --go_out
45
+ parameter set to the directory you want to output the Go code to.
46
+
47
+ protoc --go_out=. *.proto
53
48
54
49
The generated files will be suffixed .pb.go. See the Test code below
55
50
for an example using such a file.
0 commit comments