mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
run gofumpt cleanup across code-base (#14015)
This commit is contained in:
@@ -31,7 +31,7 @@ func AppendFile(dst string, src string, osync bool) error {
|
||||
if osync {
|
||||
flags |= os.O_SYNC
|
||||
}
|
||||
appendFile, err := os.OpenFile(dst, flags, 0666)
|
||||
appendFile, err := os.OpenFile(dst, flags, 0o666)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -26,13 +26,13 @@ import (
|
||||
|
||||
// AppendFile - appends the file "src" to the file "dst"
|
||||
func AppendFile(dst string, src string, osync bool) error {
|
||||
appendFile, err := lock.Open(dst, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0666)
|
||||
appendFile, err := lock.Open(dst, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0o666)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer appendFile.Close()
|
||||
|
||||
srcFile, err := lock.Open(src, os.O_RDONLY, 0666)
|
||||
srcFile, err := lock.Open(src, os.O_RDONLY, 0o666)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ func TestSameFile(t *testing.T) {
|
||||
if !SameFile(fi1, fi2) {
|
||||
t.Fatal("Expected the files to be same")
|
||||
}
|
||||
if err = goioutil.WriteFile(tmpFile, []byte("aaa"), 0644); err != nil {
|
||||
if err = goioutil.WriteFile(tmpFile, []byte("aaa"), 0o644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
fi2, err = os.Stat(tmpFile)
|
||||
|
||||
@@ -31,11 +31,11 @@ import (
|
||||
//
|
||||
// passes NOATIME flag for reads on Unix systems to avoid atime updates.
|
||||
func ReadFile(name string) ([]byte, error) {
|
||||
f, err := disk.OpenFileDirectIO(name, readMode, 0666)
|
||||
f, err := disk.OpenFileDirectIO(name, readMode, 0o666)
|
||||
if err != nil {
|
||||
// fallback if there is an error to read
|
||||
// 'name' with O_DIRECT
|
||||
f, err = os.OpenFile(name, readMode, 0666)
|
||||
f, err = os.OpenFile(name, readMode, 0o666)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user