News for hackers. Stuff that matters.
Re:Introduction to Go 1.1 by GhotiFish on Tuesday March 26, 2013 @10:49AM (#5443636)
I don't see why, personally, B defines Foo on T, so whenever B uses Foo, it should use B's Foo. C defines Foo on T, so whenever C uses Foo, it should use C's Foo. why is it ambiguous for the compiler which one to use?
Re:Introduction to Go 1.1 by pcwalton on Tuesday March 26, 2013 @10:50AM (#5443646)
If package D linked against B and C and called Foo(), which Foo() would it call?
Re:Introduction to Go 1.1 by GhotiFish on Tuesday March 26, 2013 @11:01AM (#5443722)
Good question. If package B defined the function Bar(), and package C defined the function Bar(), then if package D linked to packages B and C, which function should it call when it asks for Bar()?

Naming collisions are a solved problem.

Re:Introduction to Go 1.1 by pcwalton on Tuesday March 26, 2013 @11:06AM (#5443765)
You don't have to import methods in Go; the compiler just finds them. They're in a per-type namespace and therefore would be vulnerable to collisions. Of course, they could change the language to allow/require you to import methods, but that would add some complexity.

On the other hand, you have to import functions, so your example isn't a problem.

Re:Introduction to Go 1.1 by mseepgood on Tuesday March 26, 2013 @11:43AM (#5444028)
In Go each external function call is preceded by its package name to avoid collisions, but you don't have packages within the method namespace of a type.