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:
Jes Cok 2025-02-17 11:45:51 +00:00 committed by Gopher Robot
parent 896de17f80
commit 43d8b1e8fe

View file

@ -928,12 +928,16 @@ func TestRootConsistencyChmod(t *testing.T) {
} }
var m1, m2 os.FileMode var m1, m2 os.FileMode
err := chmod(path, 0o555) if err := chmod(path, 0o555); err != nil {
return "chmod 0o555", err
}
fi, err := lstat(path) fi, err := lstat(path)
if err == nil { if err == nil {
m1 = fi.Mode() m1 = fi.Mode()
} }
err = chmod(path, 0o777) if err = chmod(path, 0o777); err != nil {
return "chmod 0o777", err
}
fi, err = lstat(path) fi, err = lstat(path)
if err == nil { if err == nil {
m2 = fi.Mode() m2 = fi.Mode()