From c8bfd6061f5079f6c6c0155a2de1e8cd32d8a39a Mon Sep 17 00:00:00 2001 From: Jeff Halter <868228+jhalter@users.noreply.github.com> Date: Wed, 19 Apr 2023 17:53:28 -0700 Subject: Use strings.ReplaceAll method --- hotline/transaction_handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hotline/transaction_handlers.go') diff --git a/hotline/transaction_handlers.go b/hotline/transaction_handlers.go index 137b2a0..7864e19 100644 --- a/hotline/transaction_handlers.go +++ b/hotline/transaction_handlers.go @@ -1015,7 +1015,7 @@ func HandleTranOldPostNews(cc *ClientConn, t *Transaction) (res []Transaction, e } newsPost := fmt.Sprintf(newsTemplate+"\r", cc.UserName, time.Now().Format(newsDateTemplate), t.GetField(FieldData).Data) - newsPost = strings.Replace(newsPost, "\n", "\r", -1) + newsPost = strings.ReplaceAll(newsPost, "\n", "\r") // update news in memory cc.Server.FlatNews = append([]byte(newsPost), cc.Server.FlatNews...) -- cgit