Well, sorry, but if that's your level of understanding after one year of Go, I'm furious I wasted time to read your article up to that point.
Well, sorry, but if that's your level of understanding after one year of Go, I'm furious I wasted time to read your article up to that point.
And when you define an object method (or I don't know how it's called when you do this:)
func (*string) uppercase(){
// make uppercase
}Then by saying you use a pointer means you will modify the value when you do this: mystring.uppercase()
So it's not really pointers, it's more an idea of pointers.
But as soon as you're talking interface, pointers don't work as expected anymore, because Go (at least that's how I'm explaining it in my head) passes magic interface values to functions. So you can't just change `func foo(s MyStruct)` to `func foo(s MyInterface)`, but rather you probably want `func foo(s MyInterface)`. Even though you are still explicitely passing a pointer when calling foo() and whatever you're doing with s inside of foo() is working on a pointer -- which your own function declaration doesn't even tell you anymore.
This is one of the things that confuses the hell out of me when using Go.
Take a step back and think about your statement...
Try adding /s in your head and read again...
I'm curious, though, as to how you could possibly think i was being serious. Do you spend a lot of time interacting with people with insane ideas?
See http://play.golang.org/p/ToRh0uK3zw for a demonstration.
Edit: Actually, you can call a function with a value receiver on a pointer value too, so this behavior is inconsistent =/