Hi folks,
In below code, I am invoking receiver api show() via a simple uInteger
type variable instead of pointer, by which it expects to be invoked . Go
being strict with type casing and I was expecting a compiler error. But to
my surprise, it compiled and executed successfully. Can you folks please
explain this behavior.
*package mainimport "fmt"type uInteger intfunc main() { var x uInteger =
10 x.show()}func (x *uInteger) show() { fmt.Printf("In show, x =
%d\n", *x)}*
Thanks in Advance,
Venkatesh
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/CAJr0cerqTGvQA56yQWVYW3F2Ms5vbwq3YyO%2But%3DzJ%2BM4rqf81A%40mail.gmail.com.