Skip to content

Commit

Permalink
feat: grow
Browse files Browse the repository at this point in the history
  • Loading branch information
elee1766 authored and ernado committed Aug 7, 2023
1 parent d2a6a27 commit 13a4ffc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions w_grow.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package jx

import "bytes"

// Grow grows the underlying buffer.
// It calls (*bytes.Buffer).Grow(n int) on b.Buf
func (b *Buffer) Grow(n int) {
buf := bytes.NewBuffer(b.Buf)
buf.Grow(n)
b.Buf = buf.Bytes()
}

0 comments on commit 13a4ffc

Please sign in to comment.