language/go: set visibility correctly for nested internal directories (#2187)

Fixes #2186

**What type of PR is this?**

> Bug fix

**What package or component does this PR mostly affect?**

> language/go

**What does this PR do? Why is it needed?**

Added pathtools.LastIndex to accomplish this: we should be looking for
the last occurrence of "internal" in the path, not the first.

Added a test for Index in addition to LastIndex and changed the
semantics. Previously, Index ran path.Clean on both strings, but this
made the result meaningless in cases where it changed the strings.

**Which issues(s) does this PR fix?**

Fixes #2186

**Other notes for review**
14 files changed