commit | 5c176b1de44b3941fd964b684643dfda6147edfa | [log] [tgz] |
---|---|---|
author | Alan Donovan <adonovan@google.com> | Tue Jan 17 12:24:46 2023 -0500 |
committer | Alan Donovan <adonovan@google.com> | Tue Jan 17 17:44:17 2023 +0000 |
tree | 6d67d10111f1dc5112c5773780cfa0ece8529bc7 | |
parent | d34a055ab1aa3868cca11a7880ae54ad459d9d33 [diff] |
internal/robustio: skip os.Link test on android https://pkg.go.dev/internal/testenv#HasLink says: // From Android release M (Marshmallow), hard linking files is blocked // and an attempt to call link() on a file will return EACCES. // - https://code.google.com/p/android-developer-preview/issues/detail?id=3150 return runtime.GOOS != "plan9" && runtime.GOOS != "android" Fixes golang/go#57844 Change-Id: I92594daf99d3a0e74507f7f3ab806e3ed5af533f Reviewed-on: https://go-review.googlesource.com/c/tools/+/462415 TryBot-Result: Gopher Robot <gobot@golang.org> gopls-CI: kokoro <noreply+kokoro@google.com> Run-TryBot: Alan Donovan <adonovan@google.com> Reviewed-by: Bryan Mills <bcmills@google.com>
diff --git a/internal/robustio/robustio_test.go b/internal/robustio/robustio_test.go index ed49bff..af53282 100644 --- a/internal/robustio/robustio_test.go +++ b/internal/robustio/robustio_test.go
@@ -56,8 +56,10 @@ if realID != symlinkID { t.Errorf("realID %+v != symlinkID %+v", realID, symlinkID) } + } - // Two hard-linked files have the same ID. + // Two hard-linked files have the same ID. + if runtime.GOOS != "plan9" && runtime.GOOS != "android" { hardlink := filepath.Join(t.TempDir(), "hardlink") if err := os.Link(real, hardlink); err != nil { t.Fatal(err)