You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/quickstart/go.md
+82-74Lines changed: 82 additions & 74 deletions
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,8 @@ description: This guide gets you started with gRPC in Go with a simple working e
7
7
8
8
### Prerequisites
9
9
10
-
- Go version 1.6 or higher.
11
-
12
-
For installation instructions, see Go's [Getting Started](https://golang.org/doc/install) guide.
10
+
-**Go** version 1.9+. For installation instructions, see Go's [Getting
11
+
Started](https://golang.org/doc/install) guide.
13
12
14
13
#### gRPC
15
14
@@ -19,82 +18,77 @@ Use the following command to install gRPC.
19
18
$ go get -u google.golang.org/grpc
20
19
```
21
20
22
-
#### Protocol Buffers v3
23
-
24
-
Install the protoc compiler that is used to generate gRPC service code. The simplest way to do this is to download pre-compiled binaries for your platform(`protoc-<version>-<platform>.zip`) from here: [https://github.com/google/protobuf/releases](https://github.com/google/protobuf/releases)
25
-
26
-
* Unzip this file.
27
-
* Update the environment variable `PATH` to include the path to the protoc binary file.
21
+
#### Protocol Buffers
28
22
29
-
Next, install the protoc plugin for Go
30
-
31
-
```sh
32
-
$ go get -u github.com/golang/protobuf/protoc-gen-go
33
-
```
23
+
While not mandatory, gRPC applications usually leverage [Protocol Buffers][pb]
24
+
for service definitions and data serialization, and the example code uses
25
+
[proto3][].
34
26
35
-
The compiler plugin, `protoc-gen-go`, will be installed in `$GOBIN`, defaulting
36
-
to `$GOPATH/bin`. It must be in your `PATH` for the protocol compiler, protoc,
37
-
to find it.
27
+
1. Install the `protoc` compiler:
38
28
39
-
```sh
40
-
$ export PATH=$PATH:$GOPATH/bin
41
-
```
29
+
- macOS:
42
30
43
-
### Download the example
31
+
```sh
32
+
$ brew install protobuf
33
+
```
44
34
45
-
The grpc code that was fetched with `go get google.golang.org/grpc` also contains the examples. They can be found under the examples dir: `$GOPATH/src/google.golang.org/grpc/examples`.
35
+
- Any OS:
46
36
47
-
### Build the example
37
+
1. Download a zip file of the latest version of pre-compiled binaries for
38
+
your operating system from [github.com/google/protobuf/releases][]
39
+
(`protoc-<version>-<os>.zip`).
40
+
2. Unzip the file.
41
+
3. Update your environment's path variable to include the path to the
0 commit comments