From 18c38d1fb01775e179d555ea136150a978afce87 Mon Sep 17 00:00:00 2001 From: Dzyanis Kuzmenka Date: Thu, 17 Mar 2022 23:00:07 +0300 Subject: [PATCH] fixed govet issues --- .golangci.yml | 2 -- cmd/frpc/sub/root.go | 4 +++- test/e2e/plugin/server.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index ee782ece..1f43091b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -63,7 +63,6 @@ linters: - paralleltest - maintidx - ifshort - - gosimple - unparam - nakedret - misspell @@ -93,7 +92,6 @@ linters: - unconvert - varcheck - errchkjson - - govet - nilnil - thelper - ireturn diff --git a/cmd/frpc/sub/root.go b/cmd/frpc/sub/root.go index d03cdd12..a48a801d 100644 --- a/cmd/frpc/sub/root.go +++ b/cmd/frpc/sub/root.go @@ -121,7 +121,9 @@ func Execute() { } func handleSignal(svr *client.Service) { - ch := make(chan os.Signal) + // We must use a buffered channel or risk missing the signal + // if we're not ready to receive when the signal is sent. + ch := make(chan os.Signal, 1) signal.Notify(ch, syscall.SIGINT, syscall.SIGTERM) <-ch svr.GracefulClose(500 * time.Millisecond) diff --git a/test/e2e/plugin/server.go b/test/e2e/plugin/server.go index b972f78b..d12034cb 100644 --- a/test/e2e/plugin/server.go +++ b/test/e2e/plugin/server.go @@ -149,7 +149,7 @@ var _ = Describe("[Feature: Server-Plugins]", func() { [tcp] type = tcp local_port = {{ .%s }} - remote_port = 0 + remote_port = %d `, framework.TCPEchoServerPort, remotePort) f.RunProcesses([]string{serverConf}, []string{clientConf})