From e79254cce4b88455efc4d9ce7668a99b32eb74cd Mon Sep 17 00:00:00 2001 From: Malte Bauch <malte.bauch@stud.h-da.de> Date: Wed, 28 Oct 2020 12:57:33 +0100 Subject: [PATCH] fixed lint errors --- cmd/gosdn-tview/grpc/commands.go | 1 + nucleus/cli-handling.go | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cmd/gosdn-tview/grpc/commands.go b/cmd/gosdn-tview/grpc/commands.go index 1ce55dd37..5b0c07906 100644 --- a/cmd/gosdn-tview/grpc/commands.go +++ b/cmd/gosdn-tview/grpc/commands.go @@ -35,6 +35,7 @@ func Connect(address string) (*grpc.ClientConn, error) { return grpc.Dial(address, grpc.WithInsecure(), grpc.WithTimeout(5*time.Second), grpc.WithBlock()) } +//GoSDNLogStream creates a continuous gRPC stream to recieve goSDN logs func GoSDNLogStream(conn *grpc.ClientConn, clv *tview.TextView) error { var streamError error c := pb.NewGrpcCliClient(conn) diff --git a/nucleus/cli-handling.go b/nucleus/cli-handling.go index 2afb6f6f3..f4e41b78f 100644 --- a/nucleus/cli-handling.go +++ b/nucleus/cli-handling.go @@ -20,7 +20,7 @@ import ( "google.golang.org/protobuf/types/known/emptypb" ) -type LogConnection struct { +type logConnection struct { stream pb.GrpcCli_CreateLogStreamServer id string active bool @@ -31,7 +31,7 @@ type LogConnection struct { type server struct { pb.UnimplementedGrpcCliServer core *Core - logConnections []*LogConnection + logConnections []*logConnection } var srv *server @@ -52,7 +52,7 @@ func (s *server) SayHello(ctx context.Context, in *pb.HelloRequest) (*pb.HelloRe //GetLog creates a continuous stream between client and server to send goSDN logs func (s *server) CreateLogStream(req *emptypb.Empty, stream pb.GrpcCli_CreateLogStreamServer) error { - conn := &LogConnection{ + conn := &logConnection{ stream: stream, active: true, error: make(chan error), @@ -69,7 +69,7 @@ func (s *server) BroadcastLog(log *pb.LogReply) { for _, conn := range s.logConnections { wait.Add(1) - go func(conn *LogConnection) { + go func(conn *logConnection) { defer wait.Done() if conn.active { err := conn.stream.Send(log) @@ -99,7 +99,7 @@ func (s *server) Shutdown(ctx context.Context, in *pb.ShutdownRequest) (*pb.Shut func getCLIGoing(core *Core) { - var logConnections []*LogConnection + var logConnections []*logConnection var logBuffer buf log.Info("Starting: GetCLIGoing") -- GitLab