• 0 Posts
  • 1 Comment
Joined 14 days ago
cake
Cake day: October 1st, 2026

help-circle
  • One improvement here would be if the go compiler rejected unrecognized suffixes, i.e. made _test.go and _unix.go and such a whitelist, and compile errored for unrecognized suffixes, like those with look-alike unicode chars.

    As-is, adding new suffixes is arguably a breaking change since they weren’t rejected in the past, i.e. as happened to someone when _ios.go was added as a special build tag.

    I think it’s actually kinda unfortunate that go picked _ for the separator here since it’s really common to use it instead of spaces in filenames. Something like ‘foo.windows.go / foo.unix.go / foo.ios.go’ I feel like would have been easier to make a whitelist without getting in the way of people’s file-naming preferences.


    score 10 · canonical