Skip to content

Commit a010079

Browse files
authored
*: remove references to old versions of go (#6545)
1 parent 03d32b9 commit a010079

File tree

10 files changed

+27
-87
lines changed

10 files changed

+27
-87
lines changed

Documentation/proxy.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# Proxy
22

33
HTTP CONNECT proxies are supported by default in gRPC. The proxy address can be
4-
specified by the environment variables `HTTPS_PROXY` and `NO_PROXY`. Before Go
5-
1.16, if the `HTTPS_PROXY` environment variable is unset, `HTTP_PROXY` will be
6-
used instead. (Note that these environment variables are case insensitive.)
4+
specified by the environment variables `HTTPS_PROXY` and `NO_PROXY`. (Note that
5+
these environment variables are case insensitive.)
76

87
## Custom proxy
98

README.md

Lines changed: 12 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,14 @@ RPC framework that puts mobile and HTTP/2 first. For more information see the
1414

1515
## Installation
1616

17-
With [Go module][] support (Go 1.11+), simply add the following import
17+
Simply add the following import to your code, and then `go [build|run|test]`
18+
will automatically fetch the necessary dependencies:
19+
1820

1921
```go
2022
import "google.golang.org/grpc"
2123
```
2224

23-
to your code, and then `go [build|run|test]` will automatically fetch the
24-
necessary dependencies.
25-
26-
Otherwise, to install the `grpc-go` package, run the following command:
27-
28-
```console
29-
$ go get -u google.golang.org/grpc
30-
```
31-
3225
> **Note:** If you are trying to access `grpc-go` from **China**, see the
3326
> [FAQ](#FAQ) below.
3427
@@ -56,15 +49,6 @@ To build Go code, there are several options:
5649

5750
- Set up a VPN and access google.golang.org through that.
5851

59-
- Without Go module support: `git clone` the repo manually:
60-
61-
```sh
62-
git clone https://github.com/grpc/grpc-go.git $GOPATH/src/google.golang.org/grpc
63-
```
64-
65-
You will need to do the same for all of grpc's dependencies in `golang.org`,
66-
e.g. `golang.org/x/net`.
67-
6852
- With Go module support: it is possible to use the `replace` feature of `go
6953
mod` to create aliases for golang.org packages. In your project's directory:
7054

@@ -76,33 +60,13 @@ To build Go code, there are several options:
7660
```
7761

7862
Again, this will need to be done for all transitive dependencies hosted on
79-
golang.org as well. For details, refer to [golang/go issue #28652](https://github.com/golang/go/issues/28652).
63+
golang.org as well. For details, refer to [golang/go issue
64+
#28652](https://github.com/golang/go/issues/28652).
8065

8166
### Compiling error, undefined: grpc.SupportPackageIsVersion
8267

83-
#### If you are using Go modules:
84-
85-
Ensure your gRPC-Go version is `require`d at the appropriate version in
86-
the same module containing the generated `.pb.go` files. For example,
87-
`SupportPackageIsVersion6` needs `v1.27.0`, so in your `go.mod` file:
88-
89-
```go
90-
module <your module name>
91-
92-
require (
93-
google.golang.org/grpc v1.27.0
94-
)
95-
```
96-
97-
#### If you are *not* using Go modules:
98-
99-
Update the `proto` package, gRPC package, and rebuild the `.proto` files:
100-
101-
```sh
102-
go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
103-
go get -u google.golang.org/grpc
104-
protoc --go_out=plugins=grpc:. *.proto
105-
```
68+
Please update to the latest version of gRPC-Go using
69+
`go get google.golang.org/grpc`.
10670

10771
### How to turn on logging
10872

@@ -121,9 +85,11 @@ possible reasons, including:
12185
1. mis-configured transport credentials, connection failed on handshaking
12286
1. bytes disrupted, possibly by a proxy in between
12387
1. server shutdown
124-
1. Keepalive parameters caused connection shutdown, for example if you have configured
125-
your server to terminate connections regularly to [trigger DNS lookups](https://github.com/grpc/grpc-go/issues/3170#issuecomment-552517779).
126-
If this is the case, you may want to increase your [MaxConnectionAgeGrace](https://pkg.go.dev/google.golang.org/grpc/keepalive?tab=doc#ServerParameters),
88+
1. Keepalive parameters caused connection shutdown, for example if you have
89+
configured your server to terminate connections regularly to [trigger DNS
90+
lookups](https://github.com/grpc/grpc-go/issues/3170#issuecomment-552517779).
91+
If this is the case, you may want to increase your
92+
[MaxConnectionAgeGrace](https://pkg.go.dev/google.golang.org/grpc/keepalive?tab=doc#ServerParameters),
12793
to allow longer RPC calls to finish.
12894

12995
It can be tricky to debug this because the error happens on the client side but

internal/channelz/util_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
*
2020
*/
2121

22-
// The test in this file should be run in an environment that has go1.10 or later,
23-
// as the function SyscallConn() (required to get socket option) was introduced
24-
// to net.TCPListener in go1.10.
25-
2622
package channelz_test
2723

2824
import (

internal/transport/handler_server_test.go

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ func (s) TestHandlerTransport_HandleStreams(t *testing.T) {
318318
func(ctx context.Context, method string) context.Context { return ctx },
319319
)
320320
wantHeader := http.Header{
321-
"Date": {},
321+
"Date": nil,
322322
"Content-Type": {"application/grpc"},
323323
"Trailer": {"Grpc-Status", "Grpc-Message", "Grpc-Status-Details-Bin"},
324324
"Custom-Header": {"Custom header value", "Another custom header value"},
@@ -352,7 +352,7 @@ func handleStreamCloseBodyTest(t *testing.T, statusCode codes.Code, msg string)
352352
func(ctx context.Context, method string) context.Context { return ctx },
353353
)
354354
wantHeader := http.Header{
355-
"Date": {},
355+
"Date": nil,
356356
"Content-Type": {"application/grpc"},
357357
"Trailer": {"Grpc-Status", "Grpc-Message", "Grpc-Status-Details-Bin"},
358358
}
@@ -402,7 +402,7 @@ func (s) TestHandlerTransport_HandleStreams_Timeout(t *testing.T) {
402402
func(ctx context.Context, method string) context.Context { return ctx },
403403
)
404404
wantHeader := http.Header{
405-
"Date": {},
405+
"Date": nil,
406406
"Content-Type": {"application/grpc"},
407407
"Trailer": {"Grpc-Status", "Grpc-Message", "Grpc-Status-Details-Bin"},
408408
}
@@ -489,7 +489,7 @@ func (s) TestHandlerTransport_HandleStreams_ErrDetails(t *testing.T) {
489489
func(ctx context.Context, method string) context.Context { return ctx },
490490
)
491491
wantHeader := http.Header{
492-
"Date": {},
492+
"Date": nil,
493493
"Content-Type": {"application/grpc"},
494494
"Trailer": {"Grpc-Status", "Grpc-Message", "Grpc-Status-Details-Bin"},
495495
}
@@ -515,7 +515,7 @@ func (s) TestHandlerTransport_Drain(t *testing.T) {
515515
func checkHeaderAndTrailer(t *testing.T, rw testHandlerResponseWriter, wantHeader, wantTrailer http.Header) {
516516
// For trailer-only responses, the trailer values might be reported as part of the Header. They will however
517517
// be present in Trailer in either case. Hence, normalize the header by removing all trailer values.
518-
actualHeader := cloneHeader(rw.Result().Header)
518+
actualHeader := rw.Result().Header.Clone()
519519
for _, trailerKey := range actualHeader["Trailer"] {
520520
actualHeader.Del(trailerKey)
521521
}
@@ -527,21 +527,3 @@ func checkHeaderAndTrailer(t *testing.T, rw testHandlerResponseWriter, wantHeade
527527
t.Errorf("Trailer mismatch.\n got: %#v\n want: %#v", actualTrailer, wantTrailer)
528528
}
529529
}
530-
531-
// cloneHeader performs a deep clone of an http.Header, since the (http.Header).Clone() method was only added in
532-
// Go 1.13.
533-
func cloneHeader(hdr http.Header) http.Header {
534-
if hdr == nil {
535-
return nil
536-
}
537-
538-
hdrClone := make(http.Header, len(hdr))
539-
540-
for k, vv := range hdr {
541-
vvClone := make([]string, len(vv))
542-
copy(vvClone, vv)
543-
hdrClone[k] = vvClone
544-
}
545-
546-
return hdrClone
547-
}

interop/observability/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# Stage 1: Build the interop test client and server
1818
#
1919

20-
FROM golang:1.17.13-bullseye as build
20+
FROM golang:1.21-bullseye as build
2121

2222
WORKDIR /grpc-go
2323
COPY . .
@@ -36,7 +36,7 @@ RUN go build -o server/ server/server.go && \
3636
# with the given parameters.
3737
#
3838

39-
FROM golang:1.17.13-bullseye
39+
FROM golang:1.21-bullseye
4040

4141
ENV GRPC_GO_LOG_SEVERITY_LEVEL info
4242
ENV GRPC_GO_LOG_VERBOSITY_LEVEL 2

interop/xds/client/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# following command from grpc-go directory:
1717
# docker build -t <TAG> -f interop/xds/client/Dockerfile .
1818

19-
FROM golang:1.19-alpine as build
19+
FROM golang:1.21-alpine as build
2020

2121
# Make a grpc-go directory and copy the repo into it.
2222
WORKDIR /go/src/grpc-go

interop/xds/server/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# following command from grpc-go directory:
1717
# docker build -t <TAG> -f interop/xds/server/Dockerfile .
1818

19-
FROM golang:1.19-alpine as build
19+
FROM golang:1.21-alpine as build
2020

2121
# Make a grpc-go directory and copy the repo into it.
2222
WORKDIR /go/src/grpc-go

test/channelz_linux_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
*
1717
*/
1818

19-
// The test in this file should be run in an environment that has go1.10 or later,
20-
// as the function SyscallConn() (required to get socket option) was
21-
// introduced to net.TCPListener in go1.10.
22-
2319
package test
2420

2521
import (

test/kokoro/xds.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ export GOPATH="${HOME}/gopath"
99
pushd grpc-go/interop/xds/client
1010
# Install a version of Go supported by gRPC for the new features, e.g.
1111
# errors.Is()
12-
curl --retry 3 -O -L https://go.dev/dl/go1.17.3.linux-amd64.tar.gz
13-
sudo tar -C /usr/local -xf go1.17.3.linux-amd64.tar.gz
12+
gofilename=go1.21.0.linux-amd64.tar.gz
13+
curl --retry 3 -O -L "https://go.dev/dl/${gofilename}"
14+
sudo tar -C /usr/local -xf "${gofilename}"
1415
sudo ln -s /usr/local/go/bin/go /usr/bin/go
1516
# Retry go build on errors (e.g. go get connection errors), for at most 3 times
1617
for i in 1 2 3; do go build && break || sleep 5; done

vet.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ for MOD_FILE in $(find . -name 'go.mod'); do
106106
goimports -l . 2>&1 | not grep -vE "\.pb\.go"
107107
golint ./... 2>&1 | not grep -vE "/grpc_testing_not_regenerate/.*\.pb\.go:"
108108

109-
go mod tidy -compat=1.17
109+
go mod tidy -compat=1.19
110110
git status --porcelain 2>&1 | fail_on_output || \
111111
(git status; git --no-pager diff; exit 1)
112112
popd

0 commit comments

Comments
 (0)