From 45907c27fa8cd85d95cedac78e05d4ae2ab07ea2 Mon Sep 17 00:00:00 2001 From: Mahak Mukhi Date: Fri, 18 Nov 2016 14:23:08 -0800 Subject: [PATCH] go tool vet rectification --- keepalive/keepalive.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/keepalive/keepalive.go b/keepalive/keepalive.go index 686315ee..4f588ecc 100644 --- a/keepalive/keepalive.go +++ b/keepalive/keepalive.go @@ -6,6 +6,7 @@ import ( "time" ) +// Params is used to set keepalive parameters. type Params struct { // After a duration of this time the client pings the server to see if the transport is still alive. Ktime time.Duration @@ -15,13 +16,15 @@ type Params struct { KNoStream bool } -var DefaultKParams Params = Params{ +// DefaultKParams contains default values for keepalive parameters +var DefaultKParams = Params{ Ktime: time.Duration(math.MaxInt64), // default to infinite Ktimeout: time.Duration(20 * 1000 * 1000 * 1000), // default to 20 seconds KNoStream: false, } -// Mutex to protect Enabled variable -var Mu sync.Mutex = sync.Mutex{} +// MU is a mutex to protect Enabled variable +var Mu = sync.Mutex{} +// Enabled is a knob used to turn keepalive on or off var Enabled = false