style: gofumpt all the things (#9829)
Literally `gofumpt -w .` from the top level dir. Guaranteed to be minor style changes only and nothing else. @imsodin per request?
This commit is contained in:
@@ -40,13 +40,13 @@ func (e basicFileInfo) Mode() FileMode {
|
||||
}
|
||||
// Set executable bits on files with executable extensions (.exe, .bat, etc).
|
||||
if isWindowsExecutable(e.Name()) {
|
||||
m |= 0111
|
||||
m |= 0o111
|
||||
}
|
||||
// There is no user/group/others in Windows' read-only attribute, and
|
||||
// all "w" bits are set if the file is not read-only. Do not send these
|
||||
// group/others-writable bits to other devices in order to avoid
|
||||
// unexpected world-writable files on other platforms.
|
||||
m &^= 0022
|
||||
m &^= 0o022
|
||||
return FileMode(m)
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ func readReparseTag(path string) (uint32, error) {
|
||||
}
|
||||
defer syscall.CloseHandle(h)
|
||||
|
||||
//https://docs.microsoft.com/windows/win32/api/winbase/ns-winbase-file_attribute_tag_info
|
||||
// https://docs.microsoft.com/windows/win32/api/winbase/ns-winbase-file_attribute_tag_info
|
||||
const fileAttributeTagInfo = 9
|
||||
type FILE_ATTRIBUTE_TAG_INFO struct {
|
||||
FileAttributes uint32
|
||||
@@ -67,7 +67,7 @@ type dirJunctFileInfo struct {
|
||||
func (fi *dirJunctFileInfo) Mode() os.FileMode {
|
||||
// Simulate a directory and not a symlink; also set the execute
|
||||
// bits so the directory can be traversed Unix-side.
|
||||
return fi.FileInfo.Mode()&^junctionPointModeMask | os.ModeDir | 0111
|
||||
return fi.FileInfo.Mode()&^junctionPointModeMask | os.ModeDir | 0o111
|
||||
}
|
||||
|
||||
func (fi *dirJunctFileInfo) IsDir() bool {
|
||||
@@ -89,7 +89,7 @@ func init() {
|
||||
}
|
||||
|
||||
func (f *BasicFilesystem) underlyingLstat(name string) (os.FileInfo, error) {
|
||||
var fi, err = os.Lstat(name)
|
||||
fi, err := os.Lstat(name)
|
||||
|
||||
// There are cases where files are tagged as symlink, but they end up being
|
||||
// something else. Make sure we properly handle those types.
|
||||
|
||||
+14
-14
@@ -34,7 +34,7 @@ func TestChmodFile(t *testing.T) {
|
||||
fs, dir := setup(t)
|
||||
path := filepath.Join(dir, "file")
|
||||
|
||||
defer os.Chmod(path, 0666)
|
||||
defer os.Chmod(path, 0o666)
|
||||
|
||||
fd, err := os.Create(path)
|
||||
if err != nil {
|
||||
@@ -42,19 +42,19 @@ func TestChmodFile(t *testing.T) {
|
||||
}
|
||||
fd.Close()
|
||||
|
||||
if err := os.Chmod(path, 0666); err != nil {
|
||||
if err := os.Chmod(path, 0o666); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
if stat, err := os.Stat(path); err != nil || stat.Mode()&os.ModePerm != 0666 {
|
||||
if stat, err := os.Stat(path); err != nil || stat.Mode()&os.ModePerm != 0o666 {
|
||||
t.Errorf("wrong perm: %t %#o", err == nil, stat.Mode()&os.ModePerm)
|
||||
}
|
||||
|
||||
if err := fs.Chmod("file", 0444); err != nil {
|
||||
if err := fs.Chmod("file", 0o444); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
if stat, err := os.Stat(path); err != nil || stat.Mode()&os.ModePerm != 0444 {
|
||||
if stat, err := os.Stat(path); err != nil || stat.Mode()&os.ModePerm != 0o444 {
|
||||
t.Errorf("wrong perm: %t %#o", err == nil, stat.Mode()&os.ModePerm)
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@ func TestChownFile(t *testing.T) {
|
||||
fs, dir := setup(t)
|
||||
path := filepath.Join(dir, "file")
|
||||
|
||||
defer os.Chmod(path, 0666)
|
||||
defer os.Chmod(path, 0o666)
|
||||
|
||||
fd, err := os.Create(path)
|
||||
if err != nil {
|
||||
@@ -110,9 +110,9 @@ func TestChmodDir(t *testing.T) {
|
||||
fs, dir := setup(t)
|
||||
path := filepath.Join(dir, "dir")
|
||||
|
||||
mode := os.FileMode(0755)
|
||||
mode := os.FileMode(0o755)
|
||||
if build.IsWindows {
|
||||
mode = os.FileMode(0777)
|
||||
mode = os.FileMode(0o777)
|
||||
}
|
||||
|
||||
defer os.Chmod(path, mode)
|
||||
@@ -129,11 +129,11 @@ func TestChmodDir(t *testing.T) {
|
||||
t.Errorf("wrong perm: %t %#o", err == nil, stat.Mode()&os.ModePerm)
|
||||
}
|
||||
|
||||
if err := fs.Chmod("dir", 0555); err != nil {
|
||||
if err := fs.Chmod("dir", 0o555); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
if stat, err := os.Stat(path); err != nil || stat.Mode()&os.ModePerm != 0555 {
|
||||
if stat, err := os.Stat(path); err != nil || stat.Mode()&os.ModePerm != 0o555 {
|
||||
t.Errorf("wrong perm: %t %#o", err == nil, stat.Mode()&os.ModePerm)
|
||||
}
|
||||
}
|
||||
@@ -221,7 +221,7 @@ func TestDirNames(t *testing.T) {
|
||||
sort.Strings(testCases)
|
||||
|
||||
for _, sub := range testCases {
|
||||
if err := os.Mkdir(filepath.Join(dir, sub), 0777); err != nil {
|
||||
if err := os.Mkdir(filepath.Join(dir, sub), 0o777); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
@@ -256,7 +256,7 @@ func TestNames(t *testing.T) {
|
||||
t.Errorf("incorrect %s != %s (%v)", stat.Name(), expected, err)
|
||||
}
|
||||
|
||||
if err := fs.Mkdir("dir", 0777); err != nil {
|
||||
if err := fs.Mkdir("dir", 0o777); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ func TestGlob(t *testing.T) {
|
||||
filepath.Join("a", "best", "b"),
|
||||
filepath.Join("a", "best", "c"),
|
||||
} {
|
||||
if err := fs.MkdirAll(dirToCreate, 0777); err != nil {
|
||||
if err := fs.MkdirAll(dirToCreate, 0o777); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
@@ -572,7 +572,7 @@ func TestRel(t *testing.T) {
|
||||
|
||||
func TestXattr(t *testing.T) {
|
||||
tfs, _ := setup(t)
|
||||
if err := tfs.Mkdir("/test", 0755); err != nil {
|
||||
if err := tfs.Mkdir("/test", 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ func (f *BasicFilesystem) Remove(name string) error {
|
||||
err = os.Remove(name)
|
||||
if os.IsPermission(err) {
|
||||
// Try to remove the read-only attribute and try again
|
||||
if os.Chmod(name, 0600) == nil {
|
||||
if os.Chmod(name, 0o600) == nil {
|
||||
err = os.Remove(name)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ func testRealCase(t *testing.T, fsys Filesystem) {
|
||||
testFs := newCaseFilesystem(fsys)
|
||||
comps := []string{"Foo", "bar", "BAZ", "bAs"}
|
||||
path := filepath.Join(comps...)
|
||||
testFs.MkdirAll(filepath.Join(comps[:len(comps)-1]...), 0777)
|
||||
testFs.MkdirAll(filepath.Join(comps[:len(comps)-1]...), 0o777)
|
||||
fd, err := testFs.Create(path)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -93,7 +93,7 @@ func testRealCaseSensitive(t *testing.T, fsys Filesystem) {
|
||||
names[0] = "foo"
|
||||
names[1] = strings.ToUpper(names[0])
|
||||
for _, n := range names {
|
||||
if err := testFs.MkdirAll(n, 0777); err != nil {
|
||||
if err := testFs.MkdirAll(n, 0o777); err != nil {
|
||||
if IsErrCaseConflict(err) {
|
||||
t.Skip("Filesystem is case-insensitive")
|
||||
}
|
||||
|
||||
+1
-3
@@ -10,9 +10,7 @@ import (
|
||||
"github.com/syncthing/syncthing/lib/logger"
|
||||
)
|
||||
|
||||
var (
|
||||
l = logger.DefaultLogger.NewFacility("fs", "Filesystem access")
|
||||
)
|
||||
var l = logger.DefaultLogger.NewFacility("fs", "Filesystem access")
|
||||
|
||||
func init() {
|
||||
logger.DefaultLogger.NewFacility("walkfs", "Filesystem access while walking")
|
||||
|
||||
@@ -30,6 +30,7 @@ func (fs *errorFilesystem) DirNames(_ string) ([]string, error) { return nil, fs
|
||||
func (fs *errorFilesystem) GetXattr(_ string, _ XattrFilter) ([]protocol.Xattr, error) {
|
||||
return nil, fs.err
|
||||
}
|
||||
|
||||
func (fs *errorFilesystem) SetXattr(_ string, _ []protocol.Xattr, _ XattrFilter) error {
|
||||
return fs.err
|
||||
}
|
||||
@@ -60,6 +61,7 @@ func (*errorFilesystem) SameFile(_, _ FileInfo) bool { return false }
|
||||
func (fs *errorFilesystem) Watch(_ string, _ Matcher, _ context.Context, _ bool) (<-chan Event, <-chan error, error) {
|
||||
return nil, nil, fs.err
|
||||
}
|
||||
|
||||
func (fs *errorFilesystem) PlatformData(_ string, _, _ bool, _ XattrFilter) (protocol.PlatformData, error) {
|
||||
return protocol.PlatformData{}, fs.err
|
||||
}
|
||||
|
||||
+37
-37
@@ -27,7 +27,7 @@ func TestFakeFS(t *testing.T) {
|
||||
fs := newFakeFilesystem("/foo/bar/baz")
|
||||
|
||||
// MkdirAll
|
||||
err := fs.MkdirAll("dira/dirb", 0755)
|
||||
err := fs.MkdirAll("dira/dirb", 0o755)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -37,7 +37,7 @@ func TestFakeFS(t *testing.T) {
|
||||
}
|
||||
|
||||
// Mkdir
|
||||
err = fs.Mkdir("dira/dirb/dirc", 0755)
|
||||
err = fs.Mkdir("dira/dirb/dirc", 0o755)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -190,7 +190,7 @@ type test struct {
|
||||
}
|
||||
|
||||
func TestFakeFSCaseSensitive(t *testing.T) {
|
||||
var tests = []test{
|
||||
tests := []test{
|
||||
{"Read", testFakeFSRead},
|
||||
{"OpenFile", testFakeFSOpenFile},
|
||||
{"RemoveAll", testFakeFSRemoveAll},
|
||||
@@ -201,7 +201,7 @@ func TestFakeFSCaseSensitive(t *testing.T) {
|
||||
{"DirNames", testDirNames},
|
||||
{"FileName", testFakeFSFileName},
|
||||
}
|
||||
var filesystems = []testFS{
|
||||
filesystems := []testFS{
|
||||
{"fakeFS", newFakeFilesystem("/foo")},
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ func TestFakeFSCaseSensitive(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestFakeFSCaseInsensitive(t *testing.T) {
|
||||
var tests = []test{
|
||||
tests := []test{
|
||||
{"Read", testFakeFSRead},
|
||||
{"OpenFile", testFakeFSOpenFile},
|
||||
{"RemoveAll", testFakeFSRemoveAll},
|
||||
@@ -236,7 +236,7 @@ func TestFakeFSCaseInsensitive(t *testing.T) {
|
||||
{"FileNameInsens", testFakeFSFileNameInsens},
|
||||
}
|
||||
|
||||
var filesystems = []testFS{
|
||||
filesystems := []testFS{
|
||||
{"fakeFS", newFakeFilesystem("/foobar?insens=true")},
|
||||
}
|
||||
|
||||
@@ -287,7 +287,7 @@ func runTests(t *testing.T, tests []test, filesystems []testFS) {
|
||||
func testFakeFSCaseInsensitive(t *testing.T, fs Filesystem) {
|
||||
bs1 := []byte("test")
|
||||
|
||||
err := fs.Mkdir("/fUbar", 0755)
|
||||
err := fs.Mkdir("/fUbar", 0o755)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -327,12 +327,12 @@ func testFakeFSCaseInsensitive(t *testing.T, fs Filesystem) {
|
||||
}
|
||||
|
||||
func testFakeFSCaseInsensitiveMkdirAll(t *testing.T, fs Filesystem) {
|
||||
err := fs.MkdirAll("/fOO/Bar/bAz", 0755)
|
||||
err := fs.MkdirAll("/fOO/Bar/bAz", 0o755)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
fd, err := fs.OpenFile("/foo/BaR/BaZ/tESt", os.O_CREATE, 0644)
|
||||
fd, err := fs.OpenFile("/foo/BaR/BaZ/tESt", os.O_CREATE, 0o644)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -430,7 +430,7 @@ func testFakeFSStatInsens(t *testing.T, fs Filesystem) {
|
||||
}
|
||||
|
||||
func testFakeFSFileName(t *testing.T, fs Filesystem) {
|
||||
var testCases = []struct {
|
||||
testCases := []struct {
|
||||
create string
|
||||
open string
|
||||
}{
|
||||
@@ -458,7 +458,7 @@ func testFakeFSFileName(t *testing.T, fs Filesystem) {
|
||||
}
|
||||
|
||||
func testFakeFSFileNameInsens(t *testing.T, fs Filesystem) {
|
||||
var testCases = []struct {
|
||||
testCases := []struct {
|
||||
create string
|
||||
open string
|
||||
}{
|
||||
@@ -486,7 +486,7 @@ func testFakeFSFileNameInsens(t *testing.T, fs Filesystem) {
|
||||
}
|
||||
|
||||
func testFakeFSRename(t *testing.T, fs Filesystem) {
|
||||
if err := fs.MkdirAll("/foo/bar/baz", 0755); err != nil {
|
||||
if err := fs.MkdirAll("/foo/bar/baz", 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -500,7 +500,7 @@ func testFakeFSRename(t *testing.T, fs Filesystem) {
|
||||
t.Errorf("rename to non-existent dir gave no error")
|
||||
}
|
||||
|
||||
if err := fs.MkdirAll("/baz/bar/foo", 0755); err != nil {
|
||||
if err := fs.MkdirAll("/baz/bar/foo", 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -508,7 +508,7 @@ func testFakeFSRename(t *testing.T, fs Filesystem) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
var dirs = []struct {
|
||||
dirs := []struct {
|
||||
dir string
|
||||
files []string
|
||||
}{
|
||||
@@ -531,11 +531,11 @@ func testFakeFSRename(t *testing.T, fs Filesystem) {
|
||||
}
|
||||
|
||||
func testFakeFSRenameInsensitive(t *testing.T, fs Filesystem) {
|
||||
if err := fs.MkdirAll("/baz/bar/foo", 0755); err != nil {
|
||||
if err := fs.MkdirAll("/baz/bar/foo", 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := fs.MkdirAll("/foO/baR/baZ", 0755); err != nil {
|
||||
if err := fs.MkdirAll("/foO/baR/baZ", 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -550,7 +550,7 @@ func testFakeFSRenameInsensitive(t *testing.T, fs Filesystem) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
var dirs = []struct {
|
||||
dirs := []struct {
|
||||
dir string
|
||||
files []string
|
||||
}{
|
||||
@@ -582,7 +582,7 @@ func testFakeFSRenameInsensitive(t *testing.T, fs Filesystem) {
|
||||
}
|
||||
|
||||
func testFakeFSMkdir(t *testing.T, fs Filesystem) {
|
||||
if err := fs.Mkdir("/foo", 0755); err != nil {
|
||||
if err := fs.Mkdir("/foo", 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -590,13 +590,13 @@ func testFakeFSMkdir(t *testing.T, fs Filesystem) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := fs.Mkdir("/foo", 0755); err == nil {
|
||||
if err := fs.Mkdir("/foo", 0o755); err == nil {
|
||||
t.Errorf("got no error while creating existing directory")
|
||||
}
|
||||
}
|
||||
|
||||
func testFakeFSMkdirInsens(t *testing.T, fs Filesystem) {
|
||||
if err := fs.Mkdir("/foo", 0755); err != nil {
|
||||
if err := fs.Mkdir("/foo", 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -604,37 +604,37 @@ func testFakeFSMkdirInsens(t *testing.T, fs Filesystem) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := fs.Mkdir("/FOO", 0755); err == nil {
|
||||
if err := fs.Mkdir("/FOO", 0o755); err == nil {
|
||||
t.Errorf("got no error while creating existing directory")
|
||||
}
|
||||
}
|
||||
|
||||
func testFakeFSOpenFile(t *testing.T, fs Filesystem) {
|
||||
fd, err := fs.OpenFile("foobar", os.O_RDONLY, 0664)
|
||||
fd, err := fs.OpenFile("foobar", os.O_RDONLY, 0o664)
|
||||
if err == nil {
|
||||
fd.Close()
|
||||
t.Fatalf("got no error opening a non-existing file")
|
||||
}
|
||||
|
||||
fd, err = fs.OpenFile("foobar", os.O_RDWR|os.O_CREATE, 0664)
|
||||
fd, err = fs.OpenFile("foobar", os.O_RDWR|os.O_CREATE, 0o664)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
fd.Close()
|
||||
|
||||
fd, err = fs.OpenFile("foobar", os.O_RDWR|os.O_CREATE|os.O_EXCL, 0664)
|
||||
fd, err = fs.OpenFile("foobar", os.O_RDWR|os.O_CREATE|os.O_EXCL, 0o664)
|
||||
if err == nil {
|
||||
fd.Close()
|
||||
t.Fatalf("created an existing file while told not to")
|
||||
}
|
||||
|
||||
fd, err = fs.OpenFile("foobar", os.O_RDWR|os.O_CREATE, 0664)
|
||||
fd, err = fs.OpenFile("foobar", os.O_RDWR|os.O_CREATE, 0o664)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
fd.Close()
|
||||
|
||||
fd, err = fs.OpenFile("foobar", os.O_RDWR, 0664)
|
||||
fd, err = fs.OpenFile("foobar", os.O_RDWR, 0o664)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -642,31 +642,31 @@ func testFakeFSOpenFile(t *testing.T, fs Filesystem) {
|
||||
}
|
||||
|
||||
func testFakeFSOpenFileInsens(t *testing.T, fs Filesystem) {
|
||||
fd, err := fs.OpenFile("FooBar", os.O_RDONLY, 0664)
|
||||
fd, err := fs.OpenFile("FooBar", os.O_RDONLY, 0o664)
|
||||
if err == nil {
|
||||
fd.Close()
|
||||
t.Fatalf("got no error opening a non-existing file")
|
||||
}
|
||||
|
||||
fd, err = fs.OpenFile("fOObar", os.O_RDWR|os.O_CREATE, 0664)
|
||||
fd, err = fs.OpenFile("fOObar", os.O_RDWR|os.O_CREATE, 0o664)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
fd.Close()
|
||||
|
||||
fd, err = fs.OpenFile("fOoBaR", os.O_RDWR|os.O_CREATE|os.O_EXCL, 0664)
|
||||
fd, err = fs.OpenFile("fOoBaR", os.O_RDWR|os.O_CREATE|os.O_EXCL, 0o664)
|
||||
if err == nil {
|
||||
fd.Close()
|
||||
t.Fatalf("created an existing file while told not to")
|
||||
}
|
||||
|
||||
fd, err = fs.OpenFile("FoObAr", os.O_RDWR|os.O_CREATE, 0664)
|
||||
fd, err = fs.OpenFile("FoObAr", os.O_RDWR|os.O_CREATE, 0o664)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
fd.Close()
|
||||
|
||||
fd, err = fs.OpenFile("FOOBAR", os.O_RDWR, 0664)
|
||||
fd, err = fs.OpenFile("FOOBAR", os.O_RDWR, 0o664)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -674,7 +674,7 @@ func testFakeFSOpenFileInsens(t *testing.T, fs Filesystem) {
|
||||
}
|
||||
|
||||
func testFakeFSRemoveAll(t *testing.T, fs Filesystem) {
|
||||
if err := fs.Mkdir("/foo", 0755); err != nil {
|
||||
if err := fs.Mkdir("/foo", 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -702,7 +702,7 @@ func testFakeFSRemoveAll(t *testing.T, fs Filesystem) {
|
||||
}
|
||||
|
||||
func testFakeFSRemoveAllInsens(t *testing.T, fs Filesystem) {
|
||||
if err := fs.Mkdir("/Foo", 0755); err != nil {
|
||||
if err := fs.Mkdir("/Foo", 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -729,7 +729,7 @@ func testFakeFSRemoveAllInsens(t *testing.T, fs Filesystem) {
|
||||
}
|
||||
|
||||
func testFakeFSRemove(t *testing.T, fs Filesystem) {
|
||||
if err := fs.Mkdir("/Foo", 0755); err != nil {
|
||||
if err := fs.Mkdir("/Foo", 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -754,7 +754,7 @@ func testFakeFSRemove(t *testing.T, fs Filesystem) {
|
||||
}
|
||||
|
||||
func testFakeFSRemoveInsens(t *testing.T, fs Filesystem) {
|
||||
if err := fs.Mkdir("/Foo", 0755); err != nil {
|
||||
if err := fs.Mkdir("/Foo", 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -778,7 +778,7 @@ func testFakeFSRemoveInsens(t *testing.T, fs Filesystem) {
|
||||
}
|
||||
|
||||
func testFakeFSSameFile(t *testing.T, fs Filesystem) {
|
||||
if err := fs.Mkdir("/Foo", 0755); err != nil {
|
||||
if err := fs.Mkdir("/Foo", 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -810,7 +810,7 @@ func testFakeFSSameFile(t *testing.T, fs Filesystem) {
|
||||
}
|
||||
|
||||
func testFakeFSSameFileInsens(t *testing.T, fs Filesystem) {
|
||||
if err := fs.Mkdir("/Foo", 0755); err != nil {
|
||||
if err := fs.Mkdir("/Foo", 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ func TestCanonicalize(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestFileModeString(t *testing.T) {
|
||||
var fm FileMode = 0777
|
||||
var fm FileMode = 0o777
|
||||
exp := "-rwxrwxrwx"
|
||||
if fm.String() != exp {
|
||||
t.Fatalf("Got %v, expected %v", fm.String(), exp)
|
||||
|
||||
@@ -23,10 +23,10 @@ func testWalkSkipSymlink(t *testing.T, fsType FilesystemType, uri string) {
|
||||
|
||||
fs := NewFilesystem(fsType, uri)
|
||||
|
||||
if err := fs.MkdirAll("target/foo", 0755); err != nil {
|
||||
if err := fs.MkdirAll("target/foo", 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := fs.Mkdir("towalk", 0755); err != nil {
|
||||
if err := fs.Mkdir("towalk", 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := fs.CreateSymlink("target", "towalk/symlink"); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user