Родитель
a8f166a036
Коммит
5367efb805
|
@ -20,17 +20,18 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
"net"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/channelz/service"
|
||||
pb "google.golang.org/grpc/examples/helloworld/helloworld"
|
||||
"google.golang.org/grpc/resolver"
|
||||
"google.golang.org/grpc/resolver/manual"
|
||||
|
||||
pb "google.golang.org/grpc/examples/helloworld/helloworld"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -20,11 +20,11 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/channelz/service"
|
||||
"google.golang.org/grpc/internal/grpcrand"
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
package mock_helloworld
|
||||
|
||||
import (
|
||||
context "context"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
context "golang.org/x/net/context"
|
||||
grpc "google.golang.org/grpc"
|
||||
helloworld "google.golang.org/grpc/examples/helloworld/helloworld"
|
||||
)
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
package mock_routeguide
|
||||
|
||||
import (
|
||||
context "context"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
context "golang.org/x/net/context"
|
||||
grpc "google.golang.org/grpc"
|
||||
routeguide "google.golang.org/grpc/examples/route_guide/routeguide"
|
||||
metadata "google.golang.org/grpc/metadata"
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
The pb.go is genenated with an older version of codegen, to test reflection behavior with `grpc.SupportPackageIsVersion3`. DO NOT REGENERATE!
|
||||
|
||||
pb.go is manually edited to replace `"golang.org/x/net/context"` with `"context"`.
|
|
@ -19,7 +19,8 @@ import fmt "fmt"
|
|||
import math "math"
|
||||
|
||||
import (
|
||||
context "golang.org/x/net/context"
|
||||
context "context"
|
||||
|
||||
grpc "google.golang.org/grpc"
|
||||
)
|
||||
|
||||
|
|
3
vet.sh
3
vet.sh
|
@ -76,6 +76,9 @@ fi
|
|||
(! grep 'func Test[^(]' *_test.go)
|
||||
(! grep 'func Test[^(]' test/*.go)
|
||||
|
||||
# - Do not import x/net/context.
|
||||
git grep -l 'x/net/context' -- "*.go" 2>&1 | (! grep -v 'orca.pb.go')
|
||||
|
||||
# - Do not import math/rand for real library code. Use internal/grpcrand for
|
||||
# thread safety.
|
||||
git grep -l '"math/rand"' -- "*.go" 2>&1 | (! grep -v '^examples\|^stress\|grpcrand\|wrr_test')
|
||||
|
|
Загрузка…
Ссылка в новой задаче