1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-23 00:39:13 +02:00

Bump go-git

This commit is contained in:
Stefan Haller
2025-04-09 10:38:46 +02:00
parent da0105c16b
commit 4cf49ff449
527 changed files with 70489 additions and 10167 deletions
go.modgo.sum
vendor
dario.cat
github.com
Microsoft
ProtonMail
cloudflare
cyphar
emirpasic
go-git
golang
groupcache
jesseduffield
go-git
v5
.gitignoreCOMPATIBILITY.mdCONTRIBUTING.mdEXTENDING.mdMakefileREADME.mdSECURITY.mdblame.gocommon.go
config
internal
object_walker.gooptions.gooss-fuzz.sh
plumbing
prune.goreferences.goremote.gorepository.gosigner.gostatus.go
storage
submodule.go
utils
worktree.goworktree_bsd.goworktree_commit.goworktree_js.goworktree_linux.goworktree_status.goworktree_unix_other.go
kevinburke
konsorten
mitchellh
pjbgf
sergi
go-diff
sirupsen
skeema
stretchr
xanzy
golang.org
modules.txt

@ -0,0 +1,51 @@
package sync
import (
"bytes"
"sync"
)
var (
byteSlice = sync.Pool{
New: func() interface{} {
b := make([]byte, 16*1024)
return &b
},
}
bytesBuffer = sync.Pool{
New: func() interface{} {
return bytes.NewBuffer(nil)
},
}
)
// GetByteSlice returns a *[]byte that is managed by a sync.Pool.
// The initial slice length will be 16384 (16kb).
//
// After use, the *[]byte should be put back into the sync.Pool
// by calling PutByteSlice.
func GetByteSlice() *[]byte {
buf := byteSlice.Get().(*[]byte)
return buf
}
// PutByteSlice puts buf back into its sync.Pool.
func PutByteSlice(buf *[]byte) {
byteSlice.Put(buf)
}
// GetBytesBuffer returns a *bytes.Buffer that is managed by a sync.Pool.
// Returns a buffer that is reset and ready for use.
//
// After use, the *bytes.Buffer should be put back into the sync.Pool
// by calling PutBytesBuffer.
func GetBytesBuffer() *bytes.Buffer {
buf := bytesBuffer.Get().(*bytes.Buffer)
buf.Reset()
return buf
}
// PutBytesBuffer puts buf back into its sync.Pool.
func PutBytesBuffer(buf *bytes.Buffer) {
bytesBuffer.Put(buf)
}