fix: sort comments correctly

Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
Matej Focko 2023-03-28 22:14:23 +02:00
parent 0a51038cb3
commit 69afab4d44
Signed by: mfocko
GPG key ID: 7C47D46246790496

View file

@ -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
}