summaryrefslogtreecommitdiff
path: root/vendor/github.com/spf13/afero/mem
diff options
context:
space:
mode:
authorLibravatar kim <grufwub@gmail.com>2025-09-09 16:12:29 +0200
committerLibravatar kim <gruf@noreply.codeberg.org>2025-09-09 16:12:29 +0200
commitc949b9f2d137f37c8c93c916caacb182e6070e90 (patch)
tree846c6993bb27033547724c9d4b47401c7fef7ab2 /vendor/github.com/spf13/afero/mem
parent[chore] update dependencies (#4422) (diff)
downloadgotosocial-c949b9f2d137f37c8c93c916caacb182e6070e90.tar.xz
[chore] update dependencies (#4423)
- codeberg.org/gruf/go-ffmpreg: v0.6.10 -> v0.6.11 - github.com/spf13/cast: v1.9.2 -> v1.10.0 - github.com/spf13/viper: v1.20.1 -> v1.21.0 - golang.org/x/crypto: v0.41.0 -> v0.42.0 - golang.org/x/image: v0.30.0 -> v0.31.0 Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4423 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
Diffstat (limited to 'vendor/github.com/spf13/afero/mem')
-rw-r--r--vendor/github.com/spf13/afero/mem/file.go22
1 files changed, 18 insertions, 4 deletions
diff --git a/vendor/github.com/spf13/afero/mem/file.go b/vendor/github.com/spf13/afero/mem/file.go
index 62fe4498e..c77fcd40e 100644
--- a/vendor/github.com/spf13/afero/mem/file.go
+++ b/vendor/github.com/spf13/afero/mem/file.go
@@ -150,7 +150,11 @@ func (f *File) Sync() error {
func (f *File) Readdir(count int) (res []os.FileInfo, err error) {
if !f.fileData.dir {
- return nil, &os.PathError{Op: "readdir", Path: f.fileData.name, Err: errors.New("not a dir")}
+ return nil, &os.PathError{
+ Op: "readdir",
+ Path: f.fileData.name,
+ Err: errors.New("not a dir"),
+ }
}
var outLength int64
@@ -236,7 +240,11 @@ func (f *File) Truncate(size int64) error {
return ErrFileClosed
}
if f.readOnly {
- return &os.PathError{Op: "truncate", Path: f.fileData.name, Err: errors.New("file handle is read only")}
+ return &os.PathError{
+ Op: "truncate",
+ Path: f.fileData.name,
+ Err: errors.New("file handle is read only"),
+ }
}
if size < 0 {
return ErrOutOfRange
@@ -273,7 +281,11 @@ func (f *File) Write(b []byte) (n int, err error) {
return 0, ErrFileClosed
}
if f.readOnly {
- return 0, &os.PathError{Op: "write", Path: f.fileData.name, Err: errors.New("file handle is read only")}
+ return 0, &os.PathError{
+ Op: "write",
+ Path: f.fileData.name,
+ Err: errors.New("file handle is read only"),
+ }
}
n = len(b)
cur := atomic.LoadInt64(&f.at)
@@ -285,7 +297,9 @@ func (f *File) Write(b []byte) (n int, err error) {
tail = f.fileData.data[n+int(cur):]
}
if diff > 0 {
- f.fileData.data = append(f.fileData.data, append(bytes.Repeat([]byte{0o0}, int(diff)), b...)...)
+ f.fileData.data = append(
+ f.fileData.data,
+ append(bytes.Repeat([]byte{0o0}, int(diff)), b...)...)
f.fileData.data = append(f.fileData.data, tail...)
} else {
f.fileData.data = append(f.fileData.data[:cur], b...)