Skip to content

Commit

Permalink
joining one string, cool
Browse files Browse the repository at this point in the history
  • Loading branch information
stanistan committed Aug 21, 2023
1 parent 31ed67e commit d107184
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions server/internal/github/api_source_prme.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package github
import (
"context"
"fmt"
"strings"

"github.com/stanistan/present-me/internal/api"
"github.com/stanistan/present-me/internal/errors"
Expand All @@ -28,9 +27,9 @@ func (s *CommentsAPISource) GetReview(ctx context.Context) (api.Review, error) {
return api.Review{}, errors.WithStack(err)
}

var body []string
var body string
if model.PR.Body != nil && *model.PR.Body != "" {
body = append(body, *model.PR.Body)
body = *model.PR.Body
}

return api.Review{
Expand Down Expand Up @@ -62,7 +61,7 @@ func (s *CommentsAPISource) GetReview(ctx context.Context) (api.Review, error) {
MetaData: map[string]any{
"params": s.ReviewParamsMap,
},
Body: strings.Join(body, "\n\n---\n\n"),
Body: body,
Comments: transformComments(model.Comments),
}, nil
}

0 comments on commit d107184

Please sign in to comment.