module to build without errors, which it does after deleting the spurious ._<filename>.go file.
Probably the go command line tools should be ignoring these system files.
What did you see instead?
fails with "cannot find package"
I initially thought this was related to #27238 but I think it is a different problem specific to macos. However it might be worth adding a link from there in case anyone else has this problem.
The text was updated successfully, but these errors were encountered:
changed the title
gobuild is picking up macos system files and failing with cryptic messagesFeb 16, 2019
They are a standard part or macos from what I understand. I normally just add ._* to my .gitignore file. In this case I was not using VCS, since I was testing go module support with a non VCS dependency, i.e. local module using the 'replace' workaround. Hence my confusion with the reported error message.
I wouldn't be surprised if some packages were broken by the removal of dot files. I know at least some repos rely on directories with a dot or underscore prefix for packages that aren't built automatically by go build ./....
Excluding file names with the prefix ._ seems reasonable to me though.
Should these be rejected with an error or ignored? If the OS is creating them automatically for search indexing, ignoring might be the right option.
I think if you only ignore the ._ files you'll avoid the issue with .dir or _dir mentioned above.
macos includes a tool to delete these system files: 'dot_clean .' but that would mean having to run that before every build if this was treated as an error, since there is no knowing when the OS might create more.