mirror of
https://github.com/golang/go.git
synced 2025-10-19 11:03:18 +00:00
os: deal with chmod error for TestRootConsistencyChmod
Previously the error returned by chmod has not actually been used.
Change-Id: I97c947a2278a084c58784fd100630ce2a54bfb03
GitHub-Last-Rev: ddc60a044f
GitHub-Pull-Request: golang/go#71744
Reviewed-on: https://go-review.googlesource.com/c/go/+/649418
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
This commit is contained in:
parent
896de17f80
commit
43d8b1e8fe
1 changed files with 6 additions and 2 deletions
|
@ -928,12 +928,16 @@ func TestRootConsistencyChmod(t *testing.T) {
|
|||
}
|
||||
|
||||
var m1, m2 os.FileMode
|
||||
err := chmod(path, 0o555)
|
||||
if err := chmod(path, 0o555); err != nil {
|
||||
return "chmod 0o555", err
|
||||
}
|
||||
fi, err := lstat(path)
|
||||
if err == nil {
|
||||
m1 = fi.Mode()
|
||||
}
|
||||
err = chmod(path, 0o777)
|
||||
if err = chmod(path, 0o777); err != nil {
|
||||
return "chmod 0o777", err
|
||||
}
|
||||
fi, err = lstat(path)
|
||||
if err == nil {
|
||||
m2 = fi.Mode()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue