more golint cleanup

This commit is contained in:
Roland Osborne 2022-07-26 22:43:39 -07:00
parent c637bf635f
commit c16534fd52
24 changed files with 26 additions and 19 deletions

View File

@ -18,7 +18,7 @@ func AddChannelTopic(w http.ResponseWriter, r *http.Request) {
return return
} }
channelSlot, guid, err, code := getChannelSlot(r, true) channelSlot, guid, code, err := getChannelSlot(r, true)
if err != nil { if err != nil {
ErrResponse(w, code, err) ErrResponse(w, code, err)
return return

View File

@ -28,7 +28,7 @@ func AddChannelTopicAsset(w http.ResponseWriter, r *http.Request) {
} }
} }
channelSlot, guid, err, code := getChannelSlot(r, true) channelSlot, guid, code, err := getChannelSlot(r, true)
if err != nil { if err != nil {
ErrResponse(w, code, err) ErrResponse(w, code, err)
return return

View File

@ -22,7 +22,7 @@ func AddChannelTopicTag(w http.ResponseWriter, r *http.Request) {
return return
} }
channelSlot, guid, err, code := getChannelSlot(r, false) channelSlot, guid, code, err := getChannelSlot(r, false)
if err != nil { if err != nil {
ErrResponse(w, code, err) ErrResponse(w, code, err)
return return

View File

@ -8,6 +8,7 @@ import (
"net/http" "net/http"
) )
//GetCardDetail retrieves attributes attributes assigned to card
func GetCardDetail(w http.ResponseWriter, r *http.Request) { func GetCardDetail(w http.ResponseWriter, r *http.Request) {
account, code, err := ParamAgentToken(r, false) account, code, err := ParamAgentToken(r, false)

View File

@ -11,6 +11,7 @@ import (
"time" "time"
) )
//GetCardProfileImage retrieves contacts profile image
func GetCardProfileImage(w http.ResponseWriter, r *http.Request) { func GetCardProfileImage(w http.ResponseWriter, r *http.Request) {
var data []byte var data []byte

View File

@ -8,6 +8,7 @@ import (
"net/http" "net/http"
) )
//GetCardProfile retrieves contact's public profile
func GetCardProfile(w http.ResponseWriter, r *http.Request) { func GetCardProfile(w http.ResponseWriter, r *http.Request) {
account, code, err := ParamAgentToken(r, false) account, code, err := ParamAgentToken(r, false)

View File

@ -6,6 +6,7 @@ import (
"strconv" "strconv"
) )
//GetCards retrieves all accounts contacts
func GetCards(w http.ResponseWriter, r *http.Request) { func GetCards(w http.ResponseWriter, r *http.Request) {
var cardRevisionSet bool var cardRevisionSet bool
var cardRevision int64 var cardRevision int64

View File

@ -8,6 +8,7 @@ import (
"net/http" "net/http"
) )
//GetChannelDetail retrieve channel top level attributes
func GetChannelDetail(w http.ResponseWriter, r *http.Request) { func GetChannelDetail(w http.ResponseWriter, r *http.Request) {
// scan parameters // scan parameters

View File

@ -10,6 +10,7 @@ import (
"time" "time"
) )
//GetChannelSubjectField retrieve base64 decoded field from channel subject
func GetChannelSubjectField(w http.ResponseWriter, r *http.Request) { func GetChannelSubjectField(w http.ResponseWriter, r *http.Request) {
// scan parameters // scan parameters
@ -18,7 +19,7 @@ func GetChannelSubjectField(w http.ResponseWriter, r *http.Request) {
elements := strings.Split(field, ".") elements := strings.Split(field, ".")
// get channel stlot // get channel stlot
channelSlot, _, err, code := getChannelSlot(r, false) channelSlot, _, code, err := getChannelSlot(r, false)
if err != nil { if err != nil {
ErrResponse(w, code, err) ErrResponse(w, code, err)
return return

View File

@ -8,6 +8,7 @@ import (
"net/http" "net/http"
) )
//GetChannelSummary retrieves latest channel topic
func GetChannelSummary(w http.ResponseWriter, r *http.Request) { func GetChannelSummary(w http.ResponseWriter, r *http.Request) {
// scan parameters // scan parameters

View File

@ -14,7 +14,7 @@ func GetChannelTopic(w http.ResponseWriter, r *http.Request) {
params := mux.Vars(r) params := mux.Vars(r)
topicID := params["topicID"] topicID := params["topicID"]
channelSlot, _, err, code := getChannelSlot(r, false) channelSlot, _, code, err := getChannelSlot(r, false)
if err != nil { if err != nil {
ErrResponse(w, code, err) ErrResponse(w, code, err)
return return
@ -55,7 +55,7 @@ func isViewer(guid string, groups []store.Group) bool {
return false return false
} }
func getChannelSlot(r *http.Request, member bool) (slot store.ChannelSlot, guid string, err error, code int) { func getChannelSlot(r *http.Request, member bool) (slot store.ChannelSlot, guid string, code int, err error) {
// scan parameters // scan parameters
params := mux.Vars(r) params := mux.Vars(r)

View File

@ -15,7 +15,7 @@ func GetChannelTopicAsset(w http.ResponseWriter, r *http.Request) {
topicID := params["topicID"] topicID := params["topicID"]
assetID := params["assetID"] assetID := params["assetID"]
channelSlot, _, err, code := getChannelSlot(r, true) channelSlot, _, code, err := getChannelSlot(r, true)
if err != nil { if err != nil {
ErrResponse(w, code, err) ErrResponse(w, code, err)
return return

View File

@ -14,7 +14,7 @@ func GetChannelTopicAssets(w http.ResponseWriter, r *http.Request) {
params := mux.Vars(r) params := mux.Vars(r)
topicID := params["topicID"] topicID := params["topicID"]
channelSlot, guid, err, code := getChannelSlot(r, true) channelSlot, guid, code, err := getChannelSlot(r, true)
if err != nil { if err != nil {
ErrResponse(w, code, err) ErrResponse(w, code, err)
return return

View File

@ -20,7 +20,7 @@ func GetChannelTopicDetail(w http.ResponseWriter, r *http.Request) {
return return
} }
channelSlot, _, err, code := getChannelSlot(r, false) channelSlot, _, code, err := getChannelSlot(r, false)
if err != nil { if err != nil {
ErrResponse(w, code, err) ErrResponse(w, code, err)
return return

View File

@ -21,7 +21,7 @@ func GetChannelTopicSubjectField(w http.ResponseWriter, r *http.Request) {
field := params["field"] field := params["field"]
elements := strings.Split(field, ".") elements := strings.Split(field, ".")
channelSlot, _, err, code := getChannelSlot(r, false) channelSlot, _, code, err := getChannelSlot(r, false)
if err != nil { if err != nil {
ErrResponse(w, code, err) ErrResponse(w, code, err)
return return

View File

@ -22,7 +22,7 @@ func GetChannelTopicTagSubjectField(w http.ResponseWriter, r *http.Request) {
field := params["field"] field := params["field"]
elements := strings.Split(field, ".") elements := strings.Split(field, ".")
channelSlot, _, err, code := getChannelSlot(r, false) channelSlot, _, code, err := getChannelSlot(r, false)
if err != nil { if err != nil {
ErrResponse(w, code, err) ErrResponse(w, code, err)
return return

View File

@ -28,7 +28,7 @@ func GetChannelTopicTags(w http.ResponseWriter, r *http.Request) {
var count int var count int
// load channel slot // load channel slot
channelSlot, _, err, code := getChannelSlot(r, false) channelSlot, _, code, err := getChannelSlot(r, false)
if err != nil { if err != nil {
ErrResponse(w, code, err) ErrResponse(w, code, err)
return return

View File

@ -24,7 +24,7 @@ func GetChannelTopics(w http.ResponseWriter, r *http.Request) {
var countSet bool var countSet bool
var count int var count int
channelSlot, _, err, code := getChannelSlot(r, false) channelSlot, _, code, err := getChannelSlot(r, false)
if err != nil { if err != nil {
ErrResponse(w, code, err) ErrResponse(w, code, err)
return return

View File

@ -15,7 +15,7 @@ func RemoveChannelTopic(w http.ResponseWriter, r *http.Request) {
channelID := params["channelID"] channelID := params["channelID"]
topicID := params["topicID"] topicID := params["topicID"]
channelSlot, guid, err, code := getChannelSlot(r, true) channelSlot, guid, code, err := getChannelSlot(r, true)
if err != nil { if err != nil {
ErrResponse(w, code, err) ErrResponse(w, code, err)
return return

View File

@ -15,7 +15,7 @@ func RemoveChannelTopicAsset(w http.ResponseWriter, r *http.Request) {
topicID := params["topicID"] topicID := params["topicID"]
assetID := params["assetID"] assetID := params["assetID"]
channelSlot, guid, err, code := getChannelSlot(r, true) channelSlot, guid, code, err := getChannelSlot(r, true)
if err != nil { if err != nil {
ErrResponse(w, code, err) ErrResponse(w, code, err)
return return

View File

@ -16,7 +16,7 @@ func RemoveChannelTopicTag(w http.ResponseWriter, r *http.Request) {
topicID := params["topicID"] topicID := params["topicID"]
tagID := params["tagID"] tagID := params["tagID"]
channelSlot, guid, err, code := getChannelSlot(r, false) channelSlot, guid, code, err := getChannelSlot(r, false)
if err != nil { if err != nil {
ErrResponse(w, code, err) ErrResponse(w, code, err)
return return

View File

@ -24,7 +24,7 @@ func SetChannelTopicConfirmed(w http.ResponseWriter, r *http.Request) {
return return
} }
channelSlot, _, err, code := getChannelSlot(r, true) channelSlot, _, code, err := getChannelSlot(r, true)
if err != nil { if err != nil {
ErrResponse(w, code, err) ErrResponse(w, code, err)
return return

View File

@ -21,7 +21,7 @@ func SetChannelTopicSubject(w http.ResponseWriter, r *http.Request) {
return return
} }
channelSlot, guid, err, code := getChannelSlot(r, true) channelSlot, guid, code, err := getChannelSlot(r, true)
if err != nil { if err != nil {
ErrResponse(w, code, err) ErrResponse(w, code, err)
return return

View File

@ -22,7 +22,7 @@ func SetChannelTopicTagSubject(w http.ResponseWriter, r *http.Request) {
return return
} }
channelSlot, guid, err, code := getChannelSlot(r, false) channelSlot, guid, code, err := getChannelSlot(r, false)
if err != nil { if err != nil {
ErrResponse(w, code, err) ErrResponse(w, code, err)
return return