From 69afab4d44e078a0f1fa87e23cc48136919b9adf Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Tue, 28 Mar 2023 22:14:23 +0200 Subject: [PATCH] fix: sort comments correctly Signed-off-by: Matej Focko --- src/core/gitea_comments.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/gitea_comments.go b/src/core/gitea_comments.go index eba4fcf..d074128 100644 --- a/src/core/gitea_comments.go +++ b/src/core/gitea_comments.go @@ -51,9 +51,12 @@ func GetComments(config *Config, client *gitea.Client, prID int64) map[string]([ splitComments := make(map[string]([]*gitea.PullReviewComment)) for _, reviewID := range reviews { comments := RetrieveComments(config, client, prID, reviewID) - sort.Sort(ByLineNum(comments)) splitComments = SplitByFile(splitComments, comments) } + for _, comments := range splitComments { + sort.Sort(ByLineNum(comments)) + } + return splitComments }