Skip to content

Commit cf45cd4

Browse files
committed
Post-review updates
1 parent 55030ab commit cf45cd4

File tree

1 file changed

+30
-28
lines changed
  • content/docs/quickstart

1 file changed

+30
-28
lines changed

content/docs/quickstart/go.md

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,22 @@ description: This guide gets you started with gRPC in Go with a simple working e
66
protoc-version: 3.11.4
77
---
88

9+
<style type="text/css">
10+
ol ol { list-style-type: lower-alpha !important; }
11+
</style>
12+
913
### Prerequisites
1014

11-
- **Go** version 1.12+. For installation instructions, see Go's [Getting
12-
Started](https://golang.org/doc/install) guide.
15+
- **[Go][]**, any one of the **three latest major** [releases of Go][]. For
16+
installation instructions, see Go's [Getting Started][] guide.
1317

1418
#### gRPC
1519

1620
Use the following command to install gRPC as a [module][]:
1721

1822
```sh
1923
$ export GO111MODULE=on # Enable module-aware mode
20-
$ go get -u google.golang.org/grpc@{{< param grpc_release_tag >}}
24+
$ go get google.golang.org/grpc@{{< param grpc_release_tag >}}
2125
```
2226

2327
#### Protocol Buffers
@@ -28,43 +32,37 @@ for service definitions and data serialization, and the example code uses
2832

2933
1. Install the `protoc` compiler:
3034

31-
- macOS:
32-
33-
```sh
34-
$ brew install protobuf
35-
```
36-
37-
- Any OS:
35+
1. Download a zip file of the latest version of pre-compiled binaries for
36+
your operating system from [github.com/google/protobuf/releases][]
37+
(`protoc-<version>-<os><arch>.zip`). For example:
3838

39-
1. Download a zip file of the latest version of pre-compiled binaries for
40-
your operating system from [github.com/google/protobuf/releases][]
41-
(`protoc-<version>-<os><arch>.zip`). For example:
39+
```sh
40+
$ PB_REL="https://github.com/protocolbuffers/protobuf/releases"
41+
$ curl -LO $PB_REL/download/v{{< param protoc-version >}}/protoc-{{< param protoc-version >}}-linux-x86_64.zip
42+
```
4243

43-
```sh
44-
$ PB_REL="https://github.com/protocolbuffers/protobuf/releases"
45-
$ curl -LO $PB_REL/download/v{{< param protoc-version >}}/protoc-{{< param protoc-version >}}-linux-x86_64.zip
46-
```
44+
2. Unzip the file under `$HOME/.local` or a directory of your choice. For
45+
example:
4746

48-
2. Unzip the file under `$HOME/local` or a directory of your choice. For
49-
example:
47+
```sh
48+
$ unzip protoc-{{< param protoc-version >}}-linux-x86_64.zip -d $HOME/.local
49+
```
5050

51-
```sh
52-
$ unzip protoc-{{< param protoc-version >}}-linux-x86_64.zip -d $HOME/local
53-
```
51+
3. Update your environment's path variable to include the path to the
52+
`protoc` executable. For example:
5453
55-
3. Update your environment's path variable to include the path to the
56-
`protoc` executable. For example:
54+
```sh
55+
$ export PATH="$PATH:$HOME/.local/bin"
56+
```
5757
58-
```sh
59-
$ export PATH="$PATH:$HOME/local/bin"
60-
```
58+
> **MacOS note**: Using [Homebrew][]? Simply run: `brew install protobuf`.
6159
6260
2. The `protoc` plugin for Go (`protoc-gen-go`) was installed as a dependency
6361
of the `grpc` module. You can confirm this, or install the plugin, using the
6462
following command:
6563
6664
```sh
67-
$ go get -u github.com/golang/protobuf/protoc-gen-go
65+
$ go get github.com/golang/protobuf/protoc-gen-go
6866
```
6967
7068
3. Update your `PATH` so that the `protoc` compiler can find the plugin:
@@ -272,6 +270,10 @@ from the `examples/helloworld` directory:
272270
documentation](https://godoc.org/google.golang.org/grpc).
273271

274272
[github.com/google/protobuf/releases]: https://github.com/google/protobuf/releases
273+
[Getting Started]: https://golang.org/doc/install
274+
[Go]: https://golang.org
275+
[Homebrew]: https://brew.sh
275276
[module]: https://github.com/golang/go/wiki/Modules
276277
[pb]: https://developers.google.com/protocol-buffers
277278
[proto3]: https://developers.google.com/protocol-buffers/docs/proto3
279+
[releases of Go]: https://golang.org/doc/devel/release.html

0 commit comments

Comments
 (0)