Why can a non-internal package expose internals?

I have found an odd behavior and am not sure if it is a bug. Before raising an issue at GitHub - golang/go: The Go programming language, I’m interested to hear if you think this is a bug. Suppose I have two packages in my module:

  • foo/internal/bar: This package exports type MyBar struct {...}
  • foo: This package imports foo/internal/bar and defines func Foo() bar.MyBar {...}

With this “package-layout” go vet has no complaints. I can also use the Foo function from another module and, e.g., print its return value. I feel like it should not be possible to return an internal struct from a non-internal function, because this circumvents the usual restriction of an internal struct.

Do you think this is a bug as well or is there any good reason for the current behavior?

This is an accidental duplicate of Why can non-internal packages expose internals?. Please discuss at the other topic.