*: gofmt/goimports simplify
This commit is contained in:
Родитель
711a24cde2
Коммит
9aa8038716
|
@ -5,6 +5,7 @@ go:
|
|||
- 1.6
|
||||
|
||||
before_install:
|
||||
- go get golang.org/x/tools/cmd/goimports
|
||||
- go get github.com/axw/gocov/gocov
|
||||
- go get github.com/mattn/goveralls
|
||||
- go get golang.org/x/tools/cmd/cover
|
||||
|
@ -14,4 +15,6 @@ install:
|
|||
- mv "$TRAVIS_BUILD_DIR" "$GOPATH/src/google.golang.org/grpc"
|
||||
|
||||
script:
|
||||
- '! gofmt -s -d -l . 2>&1 | read'
|
||||
- '! goimports -l . | read'
|
||||
- make test testrace
|
||||
|
|
|
@ -243,7 +243,7 @@ func TestCloseWithPendingRPC(t *testing.T) {
|
|||
t.Fatalf("grpc.Invoke(_, _, _, _, _) = %v, want %s", err, servers[0].port)
|
||||
}
|
||||
// Remove the server.
|
||||
updates := []*naming.Update{&naming.Update{
|
||||
updates := []*naming.Update{{
|
||||
Op: naming.Delete,
|
||||
Addr: "127.0.0.1:" + servers[0].port,
|
||||
}}
|
||||
|
@ -287,7 +287,7 @@ func TestGetOnWaitChannel(t *testing.T) {
|
|||
t.Fatalf("Failed to create ClientConn: %v", err)
|
||||
}
|
||||
// Remove all servers so that all upcoming RPCs will block on waitCh.
|
||||
updates := []*naming.Update{&naming.Update{
|
||||
updates := []*naming.Update{{
|
||||
Op: naming.Delete,
|
||||
Addr: "127.0.0.1:" + servers[0].port,
|
||||
}}
|
||||
|
@ -310,7 +310,7 @@ func TestGetOnWaitChannel(t *testing.T) {
|
|||
}
|
||||
}()
|
||||
// Add a connected server to get the above RPC through.
|
||||
updates = []*naming.Update{&naming.Update{
|
||||
updates = []*naming.Update{{
|
||||
Op: naming.Add,
|
||||
Addr: "127.0.0.1:" + servers[0].port,
|
||||
}}
|
||||
|
|
|
@ -58,7 +58,7 @@ func closeLoopUnary() {
|
|||
|
||||
for i := 0; i < *maxConcurrentRPCs; i++ {
|
||||
go func() {
|
||||
for _ = range ch {
|
||||
for range ch {
|
||||
start := time.Now()
|
||||
unaryCaller(tc)
|
||||
elapse := time.Since(start)
|
||||
|
|
|
@ -91,14 +91,14 @@ func TestGetServiceInfo(t *testing.T) {
|
|||
|
||||
info := server.GetServiceInfo()
|
||||
want := map[string]*ServiceInfo{
|
||||
"grpc.testing.EmptyService": &ServiceInfo{
|
||||
"grpc.testing.EmptyService": {
|
||||
Methods: []MethodInfo{
|
||||
MethodInfo{
|
||||
{
|
||||
Name: "EmptyCall",
|
||||
IsClientStream: false,
|
||||
IsServerStream: false,
|
||||
},
|
||||
MethodInfo{
|
||||
{
|
||||
Name: "EmptyStream",
|
||||
IsClientStream: true,
|
||||
IsServerStream: false,
|
||||
|
|
Загрузка…
Ссылка в новой задаче