From 5823473aa4dbfd01107411eb098dfc7a905343ba Mon Sep 17 00:00:00 2001 From: Denis Tingajkin Date: Mon, 3 Feb 2020 00:28:39 +0700 Subject: [PATCH] run golangci-lint --fix Signed-off-by: Denis Tingajkin --- pkg/networkservice/chains/client/client.go | 1 - pkg/networkservice/chains/endpoint/server.go | 1 - pkg/networkservice/common/authorize/client.go | 1 - pkg/networkservice/common/authorize/server.go | 1 - pkg/networkservice/common/authorize/server_test.go | 1 - pkg/networkservice/common/clienturl/server.go | 1 - pkg/networkservice/common/discover/server.go | 1 - pkg/networkservice/common/filtermechanisms/client.go | 3 +-- pkg/networkservice/common/filtermechanisms/server.go | 3 +-- pkg/networkservice/common/heal/client.go | 1 - .../common/localbypass/networkservice_server.go | 1 - pkg/networkservice/common/monitor/server.go | 1 - pkg/networkservice/common/refresh/client.go | 1 - pkg/networkservice/common/roundrobin/server.go | 1 - pkg/networkservice/common/setid/client.go | 1 - pkg/networkservice/common/setid/server.go | 1 - pkg/networkservice/common/timeout/server.go | 1 - pkg/networkservice/common/updatepath/client.go | 1 - pkg/networkservice/common/updatepath/server.go | 1 - pkg/networkservice/core/adapters/client_to_server.go | 1 - pkg/networkservice/core/adapters/server_to_client.go | 1 - pkg/networkservice/core/next/client.go | 1 - pkg/networkservice/core/next/server.go | 1 - pkg/networkservice/core/next/tail_client.go | 1 - pkg/networkservice/core/next/tail_server.go | 1 - pkg/networkservice/core/next/tests/utils.go | 2 +- pkg/networkservice/core/trace/client.go | 1 - pkg/networkservice/core/trace/server.go | 1 - pkg/tools/serialize/serialize.go | 2 +- pkg/tools/serialize/serialize_finalizer_test.go | 8 ++++---- pkg/tools/serialize/serialize_test.go | 2 -- 31 files changed, 8 insertions(+), 37 deletions(-) diff --git a/pkg/networkservice/chains/client/client.go b/pkg/networkservice/chains/client/client.go index 70ae3f23eb..6c73a35c12 100644 --- a/pkg/networkservice/chains/client/client.go +++ b/pkg/networkservice/chains/client/client.go @@ -20,7 +20,6 @@ package client import ( "google.golang.org/grpc" - "github.com/networkservicemesh/api/pkg/api/networkservice" "github.com/networkservicemesh/sdk/pkg/networkservice/common/authorize" diff --git a/pkg/networkservice/chains/endpoint/server.go b/pkg/networkservice/chains/endpoint/server.go index ddc93235a7..2e3c0976ba 100644 --- a/pkg/networkservice/chains/endpoint/server.go +++ b/pkg/networkservice/chains/endpoint/server.go @@ -20,7 +20,6 @@ package endpoint import ( "google.golang.org/grpc" - "github.com/networkservicemesh/api/pkg/api/networkservice" "github.com/networkservicemesh/sdk/pkg/networkservice/common/authorize" diff --git a/pkg/networkservice/common/authorize/client.go b/pkg/networkservice/common/authorize/client.go index 489faa4981..bd2c8b8ec5 100644 --- a/pkg/networkservice/common/authorize/client.go +++ b/pkg/networkservice/common/authorize/client.go @@ -22,7 +22,6 @@ import ( "github.com/golang/protobuf/ptypes/empty" "google.golang.org/grpc" - "github.com/networkservicemesh/api/pkg/api/networkservice" "github.com/networkservicemesh/sdk/pkg/networkservice/core/next" diff --git a/pkg/networkservice/common/authorize/server.go b/pkg/networkservice/common/authorize/server.go index 6f115a0efd..d0c63c8533 100644 --- a/pkg/networkservice/common/authorize/server.go +++ b/pkg/networkservice/common/authorize/server.go @@ -27,7 +27,6 @@ import ( "github.com/golang/protobuf/ptypes/empty" - "github.com/networkservicemesh/api/pkg/api/networkservice" "github.com/networkservicemesh/sdk/pkg/networkservice/core/next" diff --git a/pkg/networkservice/common/authorize/server_test.go b/pkg/networkservice/common/authorize/server_test.go index 2796c8c319..99c1c90f88 100644 --- a/pkg/networkservice/common/authorize/server_test.go +++ b/pkg/networkservice/common/authorize/server_test.go @@ -25,7 +25,6 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/networkservicemesh/api/pkg/api/networkservice" "github.com/networkservicemesh/sdk/pkg/networkservice/common/authorize" diff --git a/pkg/networkservice/common/clienturl/server.go b/pkg/networkservice/common/clienturl/server.go index 04f53916f8..8d0d41688d 100644 --- a/pkg/networkservice/common/clienturl/server.go +++ b/pkg/networkservice/common/clienturl/server.go @@ -22,7 +22,6 @@ import ( "github.com/golang/protobuf/ptypes/empty" - "github.com/networkservicemesh/api/pkg/api/networkservice" "github.com/networkservicemesh/sdk/pkg/networkservice/core/next" diff --git a/pkg/networkservice/common/discover/server.go b/pkg/networkservice/common/discover/server.go index 31e1a47681..c00189cf21 100644 --- a/pkg/networkservice/common/discover/server.go +++ b/pkg/networkservice/common/discover/server.go @@ -22,7 +22,6 @@ import ( "github.com/golang/protobuf/ptypes/empty" "github.com/pkg/errors" - "github.com/networkservicemesh/api/pkg/api/networkservice" "github.com/networkservicemesh/api/pkg/api/registry" diff --git a/pkg/networkservice/common/filtermechanisms/client.go b/pkg/networkservice/common/filtermechanisms/client.go index 7c9f3511d6..79bbdbcc51 100644 --- a/pkg/networkservice/common/filtermechanisms/client.go +++ b/pkg/networkservice/common/filtermechanisms/client.go @@ -26,9 +26,8 @@ import ( "github.com/golang/protobuf/ptypes/empty" "google.golang.org/grpc" - - "github.com/networkservicemesh/api/pkg/api/networkservice/mechanisms/cls" "github.com/networkservicemesh/api/pkg/api/networkservice" + "github.com/networkservicemesh/api/pkg/api/networkservice/mechanisms/cls" "github.com/networkservicemesh/sdk/pkg/networkservice/common/clienturl" "github.com/networkservicemesh/sdk/pkg/networkservice/core/next" diff --git a/pkg/networkservice/common/filtermechanisms/server.go b/pkg/networkservice/common/filtermechanisms/server.go index 9b0c494b41..c422477bf9 100644 --- a/pkg/networkservice/common/filtermechanisms/server.go +++ b/pkg/networkservice/common/filtermechanisms/server.go @@ -22,9 +22,8 @@ import ( "github.com/golang/protobuf/ptypes/empty" "google.golang.org/grpc/peer" - - "github.com/networkservicemesh/api/pkg/api/networkservice/mechanisms/cls" "github.com/networkservicemesh/api/pkg/api/networkservice" + "github.com/networkservicemesh/api/pkg/api/networkservice/mechanisms/cls" "github.com/networkservicemesh/sdk/pkg/networkservice/core/next" ) diff --git a/pkg/networkservice/common/heal/client.go b/pkg/networkservice/common/heal/client.go index e4dfd9775c..736c74b6eb 100644 --- a/pkg/networkservice/common/heal/client.go +++ b/pkg/networkservice/common/heal/client.go @@ -26,7 +26,6 @@ import ( "github.com/pkg/errors" "google.golang.org/grpc" - "github.com/networkservicemesh/api/pkg/api/networkservice" "github.com/networkservicemesh/sdk/pkg/networkservice/core/trace" diff --git a/pkg/networkservice/common/localbypass/networkservice_server.go b/pkg/networkservice/common/localbypass/networkservice_server.go index 203bf26b12..608b547ff3 100644 --- a/pkg/networkservice/common/localbypass/networkservice_server.go +++ b/pkg/networkservice/common/localbypass/networkservice_server.go @@ -25,7 +25,6 @@ import ( "github.com/golang/protobuf/ptypes/empty" - "github.com/networkservicemesh/api/pkg/api/networkservice" "github.com/networkservicemesh/api/pkg/api/registry" diff --git a/pkg/networkservice/common/monitor/server.go b/pkg/networkservice/common/monitor/server.go index f9271ae07f..a3ba06a1d9 100644 --- a/pkg/networkservice/common/monitor/server.go +++ b/pkg/networkservice/common/monitor/server.go @@ -24,7 +24,6 @@ import ( "github.com/golang/protobuf/ptypes/empty" - "github.com/networkservicemesh/api/pkg/api/networkservice" "github.com/networkservicemesh/sdk/pkg/networkservice/core/next" diff --git a/pkg/networkservice/common/refresh/client.go b/pkg/networkservice/common/refresh/client.go index 1827e97abd..0abaff6c51 100644 --- a/pkg/networkservice/common/refresh/client.go +++ b/pkg/networkservice/common/refresh/client.go @@ -27,7 +27,6 @@ import ( "github.com/pkg/errors" "google.golang.org/grpc" - "github.com/networkservicemesh/api/pkg/api/networkservice" "github.com/networkservicemesh/sdk/pkg/networkservice/core/next" diff --git a/pkg/networkservice/common/roundrobin/server.go b/pkg/networkservice/common/roundrobin/server.go index 8047747ff5..bbd90f171c 100644 --- a/pkg/networkservice/common/roundrobin/server.go +++ b/pkg/networkservice/common/roundrobin/server.go @@ -23,7 +23,6 @@ import ( "github.com/golang/protobuf/ptypes/empty" "github.com/pkg/errors" - "github.com/networkservicemesh/api/pkg/api/networkservice" "github.com/networkservicemesh/sdk/pkg/networkservice/common/clienturl" diff --git a/pkg/networkservice/common/setid/client.go b/pkg/networkservice/common/setid/client.go index 831b6a0b07..418c1c3fb9 100644 --- a/pkg/networkservice/common/setid/client.go +++ b/pkg/networkservice/common/setid/client.go @@ -23,7 +23,6 @@ import ( "github.com/google/uuid" "google.golang.org/grpc" - "github.com/networkservicemesh/api/pkg/api/networkservice" "github.com/networkservicemesh/sdk/pkg/networkservice/core/next" diff --git a/pkg/networkservice/common/setid/server.go b/pkg/networkservice/common/setid/server.go index 45602a7b64..5cff66f9f9 100644 --- a/pkg/networkservice/common/setid/server.go +++ b/pkg/networkservice/common/setid/server.go @@ -23,7 +23,6 @@ import ( "github.com/golang/protobuf/ptypes/empty" "github.com/google/uuid" - "github.com/networkservicemesh/api/pkg/api/networkservice" "github.com/networkservicemesh/sdk/pkg/networkservice/core/next" diff --git a/pkg/networkservice/common/timeout/server.go b/pkg/networkservice/common/timeout/server.go index 20f302d3e2..0588303e2b 100644 --- a/pkg/networkservice/common/timeout/server.go +++ b/pkg/networkservice/common/timeout/server.go @@ -25,7 +25,6 @@ import ( "github.com/golang/protobuf/ptypes/empty" "github.com/pkg/errors" - "github.com/networkservicemesh/api/pkg/api/networkservice" "github.com/networkservicemesh/sdk/pkg/networkservice/core/next" diff --git a/pkg/networkservice/common/updatepath/client.go b/pkg/networkservice/common/updatepath/client.go index 9a06346bfe..53b1b51da6 100644 --- a/pkg/networkservice/common/updatepath/client.go +++ b/pkg/networkservice/common/updatepath/client.go @@ -23,7 +23,6 @@ import ( "github.com/pkg/errors" "google.golang.org/grpc" - "github.com/networkservicemesh/api/pkg/api/networkservice" "github.com/networkservicemesh/sdk/pkg/networkservice/core/next" diff --git a/pkg/networkservice/common/updatepath/server.go b/pkg/networkservice/common/updatepath/server.go index 3ce0b37f10..7130d03538 100644 --- a/pkg/networkservice/common/updatepath/server.go +++ b/pkg/networkservice/common/updatepath/server.go @@ -23,7 +23,6 @@ import ( "github.com/golang/protobuf/ptypes/empty" "github.com/pkg/errors" - "github.com/networkservicemesh/api/pkg/api/networkservice" "github.com/networkservicemesh/sdk/pkg/networkservice/core/next" diff --git a/pkg/networkservice/core/adapters/client_to_server.go b/pkg/networkservice/core/adapters/client_to_server.go index e70c2cbf70..21369d419a 100644 --- a/pkg/networkservice/core/adapters/client_to_server.go +++ b/pkg/networkservice/core/adapters/client_to_server.go @@ -22,7 +22,6 @@ import ( "github.com/golang/protobuf/ptypes/empty" - "github.com/networkservicemesh/api/pkg/api/networkservice" ) diff --git a/pkg/networkservice/core/adapters/server_to_client.go b/pkg/networkservice/core/adapters/server_to_client.go index 15d5d943fd..3bf4c32d01 100644 --- a/pkg/networkservice/core/adapters/server_to_client.go +++ b/pkg/networkservice/core/adapters/server_to_client.go @@ -23,7 +23,6 @@ import ( "github.com/golang/protobuf/ptypes/empty" "google.golang.org/grpc" - "github.com/networkservicemesh/api/pkg/api/networkservice" ) diff --git a/pkg/networkservice/core/next/client.go b/pkg/networkservice/core/next/client.go index 3f302f1b2d..efe78f64bc 100644 --- a/pkg/networkservice/core/next/client.go +++ b/pkg/networkservice/core/next/client.go @@ -24,7 +24,6 @@ import ( "github.com/golang/protobuf/ptypes/empty" "google.golang.org/grpc" - "github.com/networkservicemesh/api/pkg/api/networkservice" ) diff --git a/pkg/networkservice/core/next/server.go b/pkg/networkservice/core/next/server.go index 3e23e03a18..268afcc520 100644 --- a/pkg/networkservice/core/next/server.go +++ b/pkg/networkservice/core/next/server.go @@ -23,7 +23,6 @@ import ( "github.com/golang/protobuf/ptypes/empty" - "github.com/networkservicemesh/api/pkg/api/networkservice" ) diff --git a/pkg/networkservice/core/next/tail_client.go b/pkg/networkservice/core/next/tail_client.go index 27f976bc9e..0c4772fea3 100644 --- a/pkg/networkservice/core/next/tail_client.go +++ b/pkg/networkservice/core/next/tail_client.go @@ -22,7 +22,6 @@ import ( "github.com/golang/protobuf/ptypes/empty" "google.golang.org/grpc" - "github.com/networkservicemesh/api/pkg/api/networkservice" ) diff --git a/pkg/networkservice/core/next/tail_server.go b/pkg/networkservice/core/next/tail_server.go index 9de6f182dd..747c377ab3 100644 --- a/pkg/networkservice/core/next/tail_server.go +++ b/pkg/networkservice/core/next/tail_server.go @@ -21,7 +21,6 @@ import ( "github.com/golang/protobuf/ptypes/empty" - "github.com/networkservicemesh/api/pkg/api/networkservice" ) diff --git a/pkg/networkservice/core/next/tests/utils.go b/pkg/networkservice/core/next/tests/utils.go index e8c3956aab..f39d9d25af 100644 --- a/pkg/networkservice/core/next/tests/utils.go +++ b/pkg/networkservice/core/next/tests/utils.go @@ -21,7 +21,7 @@ import ( "context" "github.com/golang/protobuf/ptypes/empty" - + "github.com/networkservicemesh/api/pkg/api/networkservice" "google.golang.org/grpc" diff --git a/pkg/networkservice/core/trace/client.go b/pkg/networkservice/core/trace/client.go index f6f749b0e3..1d7bd5710d 100644 --- a/pkg/networkservice/core/trace/client.go +++ b/pkg/networkservice/core/trace/client.go @@ -23,7 +23,6 @@ import ( "github.com/golang/protobuf/ptypes/empty" "google.golang.org/grpc" - "github.com/networkservicemesh/api/pkg/api/networkservice" "github.com/networkservicemesh/sdk/pkg/tools/spanhelper" diff --git a/pkg/networkservice/core/trace/server.go b/pkg/networkservice/core/trace/server.go index c2bad576fa..401d05af76 100644 --- a/pkg/networkservice/core/trace/server.go +++ b/pkg/networkservice/core/trace/server.go @@ -22,7 +22,6 @@ import ( "github.com/golang/protobuf/ptypes/empty" - "github.com/networkservicemesh/api/pkg/api/networkservice" "github.com/networkservicemesh/sdk/pkg/tools/spanhelper" diff --git a/pkg/tools/serialize/serialize.go b/pkg/tools/serialize/serialize.go index e3c0f16247..8b969fe006 100644 --- a/pkg/tools/serialize/serialize.go +++ b/pkg/tools/serialize/serialize.go @@ -39,7 +39,7 @@ func NewExecutor() Executor { execCh: make(chan func(), 100), finalizedCh: make(chan struct{}), } - go eventLoop(rv.execCh,rv.finalizedCh) + go eventLoop(rv.execCh, rv.finalizedCh) runtime.SetFinalizer(rv, func(f *executor) { close(f.finalizedCh) }) diff --git a/pkg/tools/serialize/serialize_finalizer_test.go b/pkg/tools/serialize/serialize_finalizer_test.go index 2193bd3a01..0d9753017e 100644 --- a/pkg/tools/serialize/serialize_finalizer_test.go +++ b/pkg/tools/serialize/serialize_finalizer_test.go @@ -37,9 +37,9 @@ func TestFinalizer(t *testing.T) { // Run the garbage collector runtime.GC() select { - case <-finalizedCh: - return - case <- time.After(30*time.Second): - assert.Fail(t,"Timeout waiting for finalizer to run") + case <-finalizedCh: + return + case <-time.After(30 * time.Second): + assert.Fail(t, "Timeout waiting for finalizer to run") } } diff --git a/pkg/tools/serialize/serialize_test.go b/pkg/tools/serialize/serialize_test.go index 99ee51e150..4abec54bb0 100644 --- a/pkg/tools/serialize/serialize_test.go +++ b/pkg/tools/serialize/serialize_test.go @@ -138,5 +138,3 @@ func TestAsyncExecOneAtATime(t *testing.T) { <-done } } - -