chore: update the result of CR (#2354)
* chore: update the result of CR * Update utils.go * Update utils.go * Update context.go * Update context.go
This commit is contained in:
@@ -136,10 +136,11 @@ func bufApp(buf *[]byte, s string, w int, c byte) {
|
||||
|
||||
// Otherwise use either the stack buffer, if it is large enough, or
|
||||
// allocate a new buffer on the heap, and copy all previous characters.
|
||||
if l := len(s); l > cap(b) {
|
||||
*buf = make([]byte, len(s))
|
||||
length := len(s)
|
||||
if length > cap(b) {
|
||||
*buf = make([]byte, length)
|
||||
} else {
|
||||
*buf = (*buf)[:l]
|
||||
*buf = (*buf)[:length]
|
||||
}
|
||||
b = *buf
|
||||
|
||||
|
||||
Reference in New Issue
Block a user