small string split join optimization

This commit is contained in:
yusing
2024-12-19 00:54:31 +08:00
parent 654194b274
commit e7be27413c
20 changed files with 160 additions and 50 deletions

View File

@@ -3,7 +3,8 @@ package err
import (
"errors"
"fmt"
"strings"
"github.com/yusing/go-proxy/internal/utils/strutils"
)
//nolint:recvcheck
@@ -78,7 +79,7 @@ func (err *nestedError) Error() string {
if extras := makeLines(err.Extras, 1); len(extras) > 0 {
lines = append(lines, extras...)
}
return strings.Join(lines, "\n")
return strutils.JoinLines(lines)
}
//go:inline