You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while the test is running fine on Linux, on Windows it results in:
--- FAIL: TestAferoPerm (0.00s)
perm_test.go:22:
Error Trace: perm_test.go:22
Error: Should be true
Test: TestAferoPerm
perm_test.go:23:
Error Trace: perm_test.go:23
Error: Should be true
Test: TestAferoPerm
perm_test.go:24:
Error Trace: perm_test.go:24
Error: Should be true
Test: TestAferoPerm
Expected behavior
Under windows it already returns an error operation not permitted but it is not matching with os.ErrPermission
I think it would be more consistent if this behaves identical on different operating systems
The text was updated successfully, but these errors were encountered:
jochil
added a commit
to jochil/afero
that referenced
this issue
May 3, 2022
fixesspf13#350: Use `os.ErrPermission` instead of `syscall.EPerm` to make sure
that the error is consistent over different operating systems and can be
checked with `os.isPermission(err)`
I created the linked PR, where the returned error is changed from syscall.EPERM to os.ErrPermission. I think this is more idiomatic to the std package
This code creates a permission error under windows... this might helpful to verify
When using the
ReadOnlyFs
filter, the error returned when trying to write to the FS is different on Windows than on Linux or MacOSXHow to reproduce:
while the test is running fine on Linux, on Windows it results in:
Expected behavior
Under windows it already returns an error
operation not permitted
but it is not matching withos.ErrPermission
I think it would be more consistent if this behaves identical on different operating systems
The text was updated successfully, but these errors were encountered: