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
This commit is contained in:
Joe Tsai 2018-03-08 13:32:27 -08:00 коммит произвёл GitHub
Родитель 251359bf9d
Коммит 3dc8a89f96
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 4 добавлений и 7 удалений

Просмотреть файл

@ -1,9 +1,6 @@
sudo: false sudo: false
language: go language: go
go: go:
- 1.6.x
- 1.7.x
- 1.8.x
- 1.9.x - 1.9.x
- 1.10.x - 1.10.x
- 1.x - 1.x

Просмотреть файл

@ -7,7 +7,7 @@ Google's data interchange format.
Copyright 2010 The Go Authors. Copyright 2010 The Go Authors.
https://github.com/golang/protobuf 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 This software implements Go bindings for protocol buffers. For
information about protocol buffers themselves, see information about protocol buffers themselves, see

Просмотреть файл

@ -53,7 +53,7 @@ const generatedCodeVersion = 4
// Paths for packages used by code generated in this file, // Paths for packages used by code generated in this file,
// relative to the import_prefix of the generator.Generator. // relative to the import_prefix of the generator.Generator.
const ( const (
contextPkgPath = "golang.org/x/net/context" contextPkgPath = "context"
grpcPkgPath = "google.golang.org/grpc" grpcPkgPath = "google.golang.org/grpc"
) )

Просмотреть файл

@ -12,7 +12,7 @@ import fmt "fmt"
import math "math" import math "math"
import ( import (
context "golang.org/x/net/context" context "context"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
) )

2
protoc-gen-go/testdata/grpc/grpc.pb.go поставляемый
Просмотреть файл

@ -8,7 +8,7 @@ import fmt "fmt"
import math "math" import math "math"
import ( import (
context "golang.org/x/net/context" context "context"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
) )