terraform/internal/lang
Martin Atkins e95f29bf9d lang/funcs: fileexists slightly better "not a file" error message
Previously we were just returning a string representation of the file mode,
which spends more characters on the irrelevant permission bits that it
does on the directory entry type, and is presented in a Unix-centric
format that likely won't be familiar to the user of a Windows system.

Instead, we'll recognize a few specific directory entry types that seem
worth mentioning by name, and then use a generic message for the rest.

The original motivation here was actually to deal with the fact that our
tests for this function were previously not portable due to the error
message leaking system-specific permission detail that are not relevant
to the test. Rather than just directly addressing that portability
problem, I took the opportunity to improve the error messages at the same
time.

However, because of that initial focus there are only actually tests here
for the directory case. A test that tries to test any of these other file
modes would not be portable and in some cases would require superuser
access, so we'll just leave those cases untested for the moment since they
weren't tested before anyway, and so we've not _lost_ any test coverage
here.
2022-01-11 08:46:29 -08:00
..
blocktoattr refine the skipFixup heuristic 2021-09-22 16:29:50 -04:00
funcs lang/funcs: fileexists slightly better "not a file" error message 2022-01-11 08:46:29 -08:00
marks add marks.Raw 2021-06-25 14:27:43 -04:00
testdata/functions-test Move lang/ to internal/lang/ 2021-05-17 14:09:07 -07:00
data.go Move lang/ to internal/lang/ 2021-05-17 14:09:07 -07:00
data_test.go addrs: Rename AbsModuleCallOutput to ModuleCallInstanceOutput 2021-07-01 08:28:02 -07:00
doc.go Move lang/ to internal/lang/ 2021-05-17 14:09:07 -07:00
eval.go addrs: Rename AbsModuleCallOutput to ModuleCallInstanceOutput 2021-07-01 08:28:02 -07:00
eval_test.go Move lang/ to internal/lang/ 2021-05-17 14:09:07 -07:00
functions.go Move lang/ to internal/lang/ 2021-05-17 14:09:07 -07:00
functions_test.go update to use typed sensitive marks 2021-06-25 12:49:07 -04:00
references.go Move lang/ to internal/lang/ 2021-05-17 14:09:07 -07:00
scope.go Move lang/ to internal/lang/ 2021-05-17 14:09:07 -07:00