perf: use slice to improve efficiency (#57)

This commit is contained in:
JustSong 2023-05-14 12:53:03 +08:00
parent 246b981e23
commit cf6883778e

View File

@ -210,7 +210,7 @@ func relayHelper(c *gin.Context) error {
select { select {
case data := <-dataChan: case data := <-dataChan:
if strings.HasPrefix(data, "data: [DONE]") { if strings.HasPrefix(data, "data: [DONE]") {
data = "data: [DONE]" data = data[:12]
} }
c.Render(-1, common.CustomEvent{Data: data}) c.Render(-1, common.CustomEvent{Data: data})
return true return true