mirror of
https://github.com/golang/go
synced 2024-11-23 17:40:03 -07:00
os: simplify check whether to run subtest of TestRemoveAll
This commit is contained in:
parent
56c9f8e8cf
commit
e5c5db51bc
@ -80,16 +80,8 @@ func TestRemoveAll(t *testing.T) {
|
||||
t.Fatalf("Lstat %q succeeded after RemoveAll (third)", path)
|
||||
}
|
||||
|
||||
// Determine if we should run the following test.
|
||||
testit := true
|
||||
if runtime.GOOS == "windows" {
|
||||
// Chmod is not supported under windows.
|
||||
testit = false
|
||||
} else {
|
||||
// Test fails as root.
|
||||
testit = Getuid() != 0
|
||||
}
|
||||
if testit {
|
||||
// Chmod is not supported under Windows and test fails as root.
|
||||
if runtime.GOOS != "windows" && Getuid() != 0 {
|
||||
// Make directory with file and subdirectory and trigger error.
|
||||
if err = MkdirAll(dpath, 0777); err != nil {
|
||||
t.Fatalf("MkdirAll %q: %s", dpath, err)
|
||||
|
Loading…
Reference in New Issue
Block a user