Skip to content

Commit

Permalink
fixed dups
Browse files Browse the repository at this point in the history
  • Loading branch information
KenWilliamson committed Aug 30, 2023
1 parent eadc29a commit ab62693
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions handlers/adminCommentHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ func (h *MCHandler) GetAdminCommentList(w http.ResponseWriter, r *http.Request)
if uemail != nil {
cbp.MyEmail = uemail.(string)
}
var bb Blog
bb.Blog = bg
var cbb Blog
cbb.Blog = bg
txt, err := b64.StdEncoding.DecodeString(bg.Content)
if err == nil {
bg.Content = string(txt)
Expand All @@ -65,19 +65,19 @@ func (h *MCHandler) GetAdminCommentList(w http.ResponseWriter, r *http.Request)
bg.Content = strings.Replace(bg.Content, stripOut3, "", -1)
bg.Content = strings.Replace(bg.Content, stripOut4, "", -1)

bb.TextHTML = template.HTML(bg.Content)
h.Log.Debug("TextHTML: ", bb.TextHTML)
cbb.TextHTML = template.HTML(bg.Content)
h.Log.Debug("TextHTML: ", cbb.TextHTML)
}

cbp.Blog = &bb
cbp.Blog = &cbb
wg.Add(1)
go func(bbb *Blog) {
defer wg.Done()
cl := h.Delegate.GetAdminCommentList(bbb.Blog.ID, 0, maxComments)
h.Log.Debug("commentCnt: ", len(*cl))
ccl := h.Delegate.GetAdminCommentList(bbb.Blog.ID, 0, maxComments)
h.Log.Debug("commentCnt: ", len(*ccl))
var cmtLst []Comment
for i := range *cl {
cmt := (*cl)[i]
for i := range *ccl {
cmt := (*ccl)[i]
var c Comment
c.Comment = &cmt
u1 := h.Delegate.GetUserByID(cmt.UserID)
Expand All @@ -86,9 +86,9 @@ func (h *MCHandler) GetAdminCommentList(w http.ResponseWriter, r *http.Request)
cmtLst = append(cmtLst, c)
}
bbb.CommentList = &cmtLst
bbb.CommentCnt = len(*cl)
bbb.CommentCnt = len(*ccl)
h.Log.Debug("Comments Done: ")
}(&bb)
}(&cbb)

wg.Add(1)
go func(bbb *Blog) {
Expand All @@ -98,7 +98,7 @@ func (h *MCHandler) GetAdminCommentList(w http.ResponseWriter, r *http.Request)
bbb.User = u1
bbb.UserImage = b64.StdEncoding.EncodeToString(bbb.User.Image)
h.Log.Debug("User Done: ")
}(&bb)
}(&cbb)

wg.Wait()

Expand Down
4 changes: 2 additions & 2 deletions handlers/coverage.out
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ github.com/Ulbora/go-micro-blog-ui/handlers/adminCommentHandler.go:55.21,57.5 1
github.com/Ulbora/go-micro-blog-ui/handlers/adminCommentHandler.go:58.4,61.18 4 1
github.com/Ulbora/go-micro-blog-ui/handlers/adminCommentHandler.go:61.18,70.5 7 1
github.com/Ulbora/go-micro-blog-ui/handlers/adminCommentHandler.go:72.4,74.23 3 1
github.com/Ulbora/go-micro-blog-ui/handlers/adminCommentHandler.go:74.23,79.24 5 1
github.com/Ulbora/go-micro-blog-ui/handlers/adminCommentHandler.go:79.24,87.6 7 1
github.com/Ulbora/go-micro-blog-ui/handlers/adminCommentHandler.go:74.23,79.25 5 1
github.com/Ulbora/go-micro-blog-ui/handlers/adminCommentHandler.go:79.25,87.6 7 1
github.com/Ulbora/go-micro-blog-ui/handlers/adminCommentHandler.go:88.5,90.35 3 1
github.com/Ulbora/go-micro-blog-ui/handlers/adminCommentHandler.go:93.4,94.23 2 1
github.com/Ulbora/go-micro-blog-ui/handlers/adminCommentHandler.go:94.23,101.5 6 1
Expand Down
Binary file modified main
Binary file not shown.

0 comments on commit ab62693

Please sign in to comment.