mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-16 08:27:06 +08:00
vendor: update buildkit with typed errors support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
10
vendor/github.com/tonistiigi/fsutil/send.go
generated
vendored
10
vendor/github.com/tonistiigi/fsutil/send.go
generated
vendored
@ -5,6 +5,7 @@ import (
|
||||
"io"
|
||||
"os"
|
||||
"sync"
|
||||
"syscall"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/tonistiigi/fsutil/types"
|
||||
@ -13,7 +14,8 @@ import (
|
||||
|
||||
var bufPool = sync.Pool{
|
||||
New: func() interface{} {
|
||||
return make([]byte, 32*1<<10)
|
||||
buf := make([]byte, 32*1<<10)
|
||||
return &buf
|
||||
},
|
||||
}
|
||||
|
||||
@ -131,9 +133,9 @@ func (s *sender) sendFile(h *sendHandle) error {
|
||||
f, err := s.fs.Open(h.path)
|
||||
if err == nil {
|
||||
defer f.Close()
|
||||
buf := bufPool.Get().([]byte)
|
||||
buf := bufPool.Get().(*[]byte)
|
||||
defer bufPool.Put(buf)
|
||||
if _, err := io.CopyBuffer(&fileSender{sender: s, id: h.id}, f, buf); err != nil {
|
||||
if _, err := io.CopyBuffer(&fileSender{sender: s, id: h.id}, f, *buf); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@ -148,7 +150,7 @@ func (s *sender) walk(ctx context.Context) error {
|
||||
}
|
||||
stat, ok := fi.Sys().(*types.Stat)
|
||||
if !ok {
|
||||
return errors.Wrapf(err, "invalid fileinfo without stat info: %s", path)
|
||||
return errors.WithStack(&os.PathError{Path: path, Err: syscall.EBADMSG, Op: "fileinfo without stat info"})
|
||||
}
|
||||
|
||||
p := &types.Packet{
|
||||
|
Reference in New Issue
Block a user