Sorry, terrible example... I meant something like this:


type M struct{}

func (m M) Max() int {
return 5

func foo() {
math := M{}

If shadowing didn't work, importing math would suddenly break this program.
On Thursday, February 21, 2013 6:34:46 PM UTC-5, John Nagle wrote:
On 2/21/2013 7:16 AM, Nate Finch wrote:
If you later import "math" into this file, this function suddenly becomes
invalid if you can't shadow. Since anyone can name imports whatever they
want, this could be a huge pain (yes you could rename the import).
"import" only brings in upper case variables, right? (Except for
the module name itself.)

John Nagle
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts


Follow ups

Related Discussions



site design / logo © 2021 Grokbase