From 3dc8a89f965ba7bf716fd0d92b83c5da1792ab9c Mon Sep 17 00:00:00 2001 From: Joe Tsai Date: Thu, 8 Mar 2018 13:32:27 -0800 Subject: [PATCH] protoc-gen-go: use standard library context (requires Go1.9) (#548) This change effectively makes Go1.9 the minimum required version of Go when using gRPC since type aliases are needed to truly unify context. Even though this only affects those who use gRPC, there are other reasons we need Go1.9 (such as type aliases for import public). Fixes #537 --- .travis.yml | 3 --- README.md | 2 +- protoc-gen-go/grpc/grpc.go | 2 +- protoc-gen-go/testdata/deprecated/deprecated.pb.go | 2 +- protoc-gen-go/testdata/grpc/grpc.pb.go | 2 +- 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 58e3568453..635293eac2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,6 @@ sudo: false language: go go: -- 1.6.x -- 1.7.x -- 1.8.x - 1.9.x - 1.10.x - 1.x diff --git a/README.md b/README.md index 01b29daf26..836cee4c47 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Google's data interchange format. Copyright 2010 The Go Authors. https://github.com/golang/protobuf -This package and the code it generates requires at least Go 1.6. +This package and the code it generates requires at least Go 1.9. This software implements Go bindings for protocol buffers. For information about protocol buffers themselves, see diff --git a/protoc-gen-go/grpc/grpc.go b/protoc-gen-go/grpc/grpc.go index 1723680a8b..e30f9aeef9 100644 --- a/protoc-gen-go/grpc/grpc.go +++ b/protoc-gen-go/grpc/grpc.go @@ -53,7 +53,7 @@ const generatedCodeVersion = 4 // Paths for packages used by code generated in this file, // relative to the import_prefix of the generator.Generator. const ( - contextPkgPath = "golang.org/x/net/context" + contextPkgPath = "context" grpcPkgPath = "google.golang.org/grpc" ) diff --git a/protoc-gen-go/testdata/deprecated/deprecated.pb.go b/protoc-gen-go/testdata/deprecated/deprecated.pb.go index 6ebae9da3a..e81f932d90 100644 --- a/protoc-gen-go/testdata/deprecated/deprecated.pb.go +++ b/protoc-gen-go/testdata/deprecated/deprecated.pb.go @@ -12,7 +12,7 @@ import fmt "fmt" import math "math" import ( - context "golang.org/x/net/context" + context "context" grpc "google.golang.org/grpc" ) diff --git a/protoc-gen-go/testdata/grpc/grpc.pb.go b/protoc-gen-go/testdata/grpc/grpc.pb.go index 0bb4cbfd1b..ee68f477c7 100644 --- a/protoc-gen-go/testdata/grpc/grpc.pb.go +++ b/protoc-gen-go/testdata/grpc/grpc.pb.go @@ -8,7 +8,7 @@ import fmt "fmt" import math "math" import ( - context "golang.org/x/net/context" + context "context" grpc "google.golang.org/grpc" )