Reformat example code on PostDescription

This commit is contained in:
Matt Baer
2023-04-04 12:10:40 -04:00
parent 4e8d67e937
commit 4934315624
+7 -6
View File
@@ -76,12 +76,13 @@ func FriendlyPostTitle(content, friendlyId string) string {
// choosing what to generate. In case a post has a title, this function will // choosing what to generate. In case a post has a title, this function will
// fail, and logic should instead be implemented to skip this when there's no // fail, and logic should instead be implemented to skip this when there's no
// title, like so: // title, like so:
// var desc string //
// if title == "" { // var desc string
// desc = PostDescription(content, title, friendlyId) // if title == "" {
// } else { // desc = PostDescription(content, title, friendlyId)
// desc = ShortPostDescription(content) // } else {
// } // desc = ShortPostDescription(content)
// }
func PostDescription(content, title, friendlyId string) string { func PostDescription(content, title, friendlyId string) string {
maxLen := 140 maxLen := 140