This is my sixth time to learn go,it has been a long time since the last learning.During this learning,i learned
(1) methods
go does not have classes,butbwe can define methods on types.You can only declare a method with a receiver whose type is defined in the samepackage as the method. You cannot declare a method with a receiver whose type ísdefined in another package (which includes the built-in types such as int).
Functions that take a value argument must take a value of that specific type:
all methods on a given type should have either value or pointer receivers,but not a mixture of both.
(2)interface
If the concrete value inside the interface itself is nil, the method will be called with a nilreceiver.Note that an interface value that holds a nil concrete value is itself non-nil.
type assertion,has similarity in syntax with map.
stringer,A Stringer
is a type that can describe itself as a string. and reader interface \image interface .
because i have long time not to read ,the speed of reading is slow.it cost me 90 minutes.i need to insist.