Родитель
a8f166a036
Коммит
5367efb805
|
@ -20,17 +20,18 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"golang.org/x/net/context"
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/channelz/service"
|
"google.golang.org/grpc/channelz/service"
|
||||||
pb "google.golang.org/grpc/examples/helloworld/helloworld"
|
|
||||||
"google.golang.org/grpc/resolver"
|
"google.golang.org/grpc/resolver"
|
||||||
"google.golang.org/grpc/resolver/manual"
|
"google.golang.org/grpc/resolver/manual"
|
||||||
|
|
||||||
|
pb "google.golang.org/grpc/examples/helloworld/helloworld"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -20,11 +20,11 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"golang.org/x/net/context"
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/channelz/service"
|
"google.golang.org/grpc/channelz/service"
|
||||||
"google.golang.org/grpc/internal/grpcrand"
|
"google.golang.org/grpc/internal/grpcrand"
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
package mock_helloworld
|
package mock_helloworld
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
context "context"
|
||||||
gomock "github.com/golang/mock/gomock"
|
gomock "github.com/golang/mock/gomock"
|
||||||
context "golang.org/x/net/context"
|
|
||||||
grpc "google.golang.org/grpc"
|
grpc "google.golang.org/grpc"
|
||||||
helloworld "google.golang.org/grpc/examples/helloworld/helloworld"
|
helloworld "google.golang.org/grpc/examples/helloworld/helloworld"
|
||||||
)
|
)
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
package mock_routeguide
|
package mock_routeguide
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
context "context"
|
||||||
gomock "github.com/golang/mock/gomock"
|
gomock "github.com/golang/mock/gomock"
|
||||||
context "golang.org/x/net/context"
|
|
||||||
grpc "google.golang.org/grpc"
|
grpc "google.golang.org/grpc"
|
||||||
routeguide "google.golang.org/grpc/examples/route_guide/routeguide"
|
routeguide "google.golang.org/grpc/examples/route_guide/routeguide"
|
||||||
metadata "google.golang.org/grpc/metadata"
|
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 math "math"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
context "golang.org/x/net/context"
|
context "context"
|
||||||
|
|
||||||
grpc "google.golang.org/grpc"
|
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)
|
||||||
(! 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
|
# - Do not import math/rand for real library code. Use internal/grpcrand for
|
||||||
# thread safety.
|
# thread safety.
|
||||||
git grep -l '"math/rand"' -- "*.go" 2>&1 | (! grep -v '^examples\|^stress\|grpcrand\|wrr_test')
|
git grep -l '"math/rand"' -- "*.go" 2>&1 | (! grep -v '^examples\|^stress\|grpcrand\|wrr_test')
|
||||||
|
|
Загрузка…
Ссылка в новой задаче