From 200ba4b9f8ab3c726b4daf349521788dc00deeca Mon Sep 17 00:00:00 2001 From: Roland Osborne Date: Fri, 29 Jul 2022 14:57:25 -0700 Subject: [PATCH] more golint cleanup --- net/server/internal/api_removeChannelTopicTag.go | 8 ++++---- net/server/internal/api_setChannelCard.go | 1 + net/server/internal/api_setChannelGroup.go | 1 + net/server/internal/api_setChannelRevision.go | 2 ++ net/server/internal/api_setChannelSubject.go | 1 + net/server/internal/api_setChannelTopicConfirmed.go | 1 + net/server/internal/api_setChannelTopicSubject.go | 1 + net/server/internal/api_setChannelTopicTagSubject.go | 1 + net/server/internal/api_setCloseMessage.go | 1 + net/server/internal/api_setGroupSubject.go | 1 + 10 files changed, 14 insertions(+), 4 deletions(-) diff --git a/net/server/internal/api_removeChannelTopicTag.go b/net/server/internal/api_removeChannelTopicTag.go index 168c8dbf..106b6b1d 100644 --- a/net/server/internal/api_removeChannelTopicTag.go +++ b/net/server/internal/api_removeChannelTopicTag.go @@ -61,10 +61,10 @@ func RemoveChannelTopicTag(w http.ResponseWriter, r *http.Request) { } // check permission - if act.GUID != guid && topicSlot.Topic.GUID != guid { - ErrResponse(w, http.StatusUnauthorized, errors.New("not creator of topic or host")) - return - } + if act.GUID != guid && topicSlot.Topic.GUID != guid { + ErrResponse(w, http.StatusUnauthorized, errors.New("not creator of topic or host")) + return + } err = store.DB.Transaction(func(tx *gorm.DB) error { diff --git a/net/server/internal/api_setChannelCard.go b/net/server/internal/api_setChannelCard.go index 7a35e0a8..41128af6 100644 --- a/net/server/internal/api_setChannelCard.go +++ b/net/server/internal/api_setChannelCard.go @@ -8,6 +8,7 @@ import ( "net/http" ) +//SetChannelCard adds contact to channel membership func SetChannelCard(w http.ResponseWriter, r *http.Request) { account, code, err := ParamAgentToken(r, false) diff --git a/net/server/internal/api_setChannelGroup.go b/net/server/internal/api_setChannelGroup.go index accd2858..162110f8 100644 --- a/net/server/internal/api_setChannelGroup.go +++ b/net/server/internal/api_setChannelGroup.go @@ -8,6 +8,7 @@ import ( "net/http" ) +//SetChannelGroup adds sharing group to channel func SetChannelGroup(w http.ResponseWriter, r *http.Request) { account, code, err := BearerAppToken(r, false) diff --git a/net/server/internal/api_setChannelRevision.go b/net/server/internal/api_setChannelRevision.go index d7fcda3e..27ff8555 100644 --- a/net/server/internal/api_setChannelRevision.go +++ b/net/server/internal/api_setChannelRevision.go @@ -6,6 +6,7 @@ import ( "net/http" ) +//SetChannelRevision notifies contact of updated channel revision func SetChannelRevision(w http.ResponseWriter, r *http.Request) { card, code, err := ParamContactToken(r, false) @@ -28,6 +29,7 @@ func SetChannelRevision(w http.ResponseWriter, r *http.Request) { WriteResponse(w, nil) } +//NotifyChannelRevision stores updated channel revision func NotifyChannelRevision(card *store.Card, revision int64) error { act := &card.Account diff --git a/net/server/internal/api_setChannelSubject.go b/net/server/internal/api_setChannelSubject.go index 4ada6a5a..d5c5f381 100644 --- a/net/server/internal/api_setChannelSubject.go +++ b/net/server/internal/api_setChannelSubject.go @@ -8,6 +8,7 @@ import ( "net/http" ) +//SetChannelSubject updates channel subject for account holder func SetChannelSubject(w http.ResponseWriter, r *http.Request) { account, code, err := ParamAgentToken(r, false) diff --git a/net/server/internal/api_setChannelTopicConfirmed.go b/net/server/internal/api_setChannelTopicConfirmed.go index e03f93a7..ef8cb278 100644 --- a/net/server/internal/api_setChannelTopicConfirmed.go +++ b/net/server/internal/api_setChannelTopicConfirmed.go @@ -8,6 +8,7 @@ import ( "net/http" ) +//SetChannelTopicConfirmed sets confirmation status of topic func SetChannelTopicConfirmed(w http.ResponseWriter, r *http.Request) { // scan parameters diff --git a/net/server/internal/api_setChannelTopicSubject.go b/net/server/internal/api_setChannelTopicSubject.go index 4cdbe54d..4e06ec65 100644 --- a/net/server/internal/api_setChannelTopicSubject.go +++ b/net/server/internal/api_setChannelTopicSubject.go @@ -8,6 +8,7 @@ import ( "net/http" ) +//SetChannelTopicSubject sets subject of channel topic created by invoker func SetChannelTopicSubject(w http.ResponseWriter, r *http.Request) { // scan parameters diff --git a/net/server/internal/api_setChannelTopicTagSubject.go b/net/server/internal/api_setChannelTopicTagSubject.go index e5404a0e..52019078 100644 --- a/net/server/internal/api_setChannelTopicTagSubject.go +++ b/net/server/internal/api_setChannelTopicTagSubject.go @@ -8,6 +8,7 @@ import ( "net/http" ) +//SetChannelTopicTagSubject sets subject of tag created by invoker func SetChannelTopicTagSubject(w http.ResponseWriter, r *http.Request) { // scan parameters diff --git a/net/server/internal/api_setCloseMessage.go b/net/server/internal/api_setCloseMessage.go index d7ed7e14..ff6b327d 100644 --- a/net/server/internal/api_setCloseMessage.go +++ b/net/server/internal/api_setCloseMessage.go @@ -8,6 +8,7 @@ import ( "time" ) +//SetCloseMessage delivers disconnection message to contact func SetCloseMessage(w http.ResponseWriter, r *http.Request) { var message DataMessage diff --git a/net/server/internal/api_setGroupSubject.go b/net/server/internal/api_setGroupSubject.go index c7ed4ae6..112e7354 100644 --- a/net/server/internal/api_setGroupSubject.go +++ b/net/server/internal/api_setGroupSubject.go @@ -8,6 +8,7 @@ import ( "net/http" ) +//SetGroupSubject sets subject of group under account func SetGroupSubject(w http.ResponseWriter, r *http.Request) { account, code, err := ParamAgentToken(r, true)