From 6cf57a9b39d5dc46c58b7ad4ba08bc63daea8cad Mon Sep 17 00:00:00 2001 From: or-else Date: Sun, 27 Dec 2020 11:28:38 -0800 Subject: [PATCH] still more lint warning regarding various comments issues --- server/cluster.go | 2 +- server/concurrency/goroutinepool.go | 9 +++------ server/concurrency/simplemutex.go | 3 --- server/datamodel.go | 2 +- server/push/tnpg/push_tnpg.go | 2 +- server/session.go | 14 +++++++------- server/stats.go | 3 +-- 7 files changed, 14 insertions(+), 21 deletions(-) diff --git a/server/cluster.go b/server/cluster.go index f9f25417c..546bc6559 100644 --- a/server/cluster.go +++ b/server/cluster.go @@ -42,7 +42,7 @@ const ( ProxyReqMeUserAgent ) -// Proxy event types processed in the clusterWriteLoop. +// ProxyEventType is an enumeration of possible proxy event types processed in the clusterWriteLoop. type ProxyEventType int // Individual proxy events. diff --git a/server/concurrency/goroutinepool.go b/server/concurrency/goroutinepool.go index ccaeb7ae5..fd7ab7b48 100644 --- a/server/concurrency/goroutinepool.go +++ b/server/concurrency/goroutinepool.go @@ -1,9 +1,6 @@ -/****************************************************************************** - * - * Description : - * A very basic and naive implementation of thread pool. - * - *****************************************************************************/ +// Package concurrency is a very simple implementation of a mutex with channels. +// Provides TryLock functionality absent in Go's regular sync.Mutex. +// See https://github.com/golang/go/issues/6123 for details. package concurrency // Task represents a work task to be run on the specified thread pool. diff --git a/server/concurrency/simplemutex.go b/server/concurrency/simplemutex.go index 083c878d3..9a59bf715 100644 --- a/server/concurrency/simplemutex.go +++ b/server/concurrency/simplemutex.go @@ -1,6 +1,3 @@ -// Package concurrency is a very simple implementation of a mutex with channels. -// Provides TryLock functionality absent in Go's regular sync.Mutex. -// See https://github.com/golang/go/issues/6123 for details. package concurrency // SimpleMutex is a channel used for locking. diff --git a/server/datamodel.go b/server/datamodel.go index b182f9452..ebe5d1176 100644 --- a/server/datamodel.go +++ b/server/datamodel.go @@ -929,7 +929,7 @@ func NoErrDeliveredParams(id, topic string, ts time.Time, params interface{}) *S // 3xx -// InfoValidateCredentials requires user to confirm credentials before going forward (300). +// InfoValidateCredentialsExplicitTs requires user to confirm credentials before going forward (300). func InfoValidateCredentials(id string, ts time.Time) *ServerComMessage { return InfoValidateCredentialsExplicitTs(id, ts, ts) } diff --git a/server/push/tnpg/push_tnpg.go b/server/push/tnpg/push_tnpg.go index 56d1236da..ac006d364 100644 --- a/server/push/tnpg/push_tnpg.go +++ b/server/push/tnpg/push_tnpg.go @@ -295,7 +295,7 @@ func (Handler) Push() chan<- *push.Receipt { return handler.input } -// Push returns a channel that the server will use to send messages to. +// Channel returns a channel that the server will use to send group requests to. // If the adapter blocks, the message will be dropped. func (Handler) Channel() chan<- *push.ChannelReq { return handler.channel diff --git a/server/session.go b/server/session.go index fa4b61a01..e69d8a370 100644 --- a/server/session.go +++ b/server/session.go @@ -328,15 +328,15 @@ func (s *Session) stopSession(data interface{}) { s.stop <- data } -func (sess *Session) purgeChannels() { - for len(sess.send) > 0 { - <-sess.send +func (s *Session) purgeChannels() { + for len(s.send) > 0 { + <-s.send } - for len(sess.stop) > 0 { - <-sess.stop + for len(s.stop) > 0 { + <-s.stop } - for len(sess.detach) > 0 { - <-sess.detach + for len(s.detach) > 0 { + <-s.detach } } diff --git a/server/stats.go b/server/stats.go index 2292cd4a0..06c4f84be 100644 --- a/server/stats.go +++ b/server/stats.go @@ -38,9 +38,8 @@ func (h *histogram) addSample(v float64) { func (h *histogram) String() string { if r, err := json.Marshal(h); err == nil { return string(r) - } else { - return "" } + return "" } type varUpdate struct {