func (t *T) MethodName(argType T1, replyType *T2) error
what is contents in parenthesis before MethodName? I mean this (t *T)
This comes from
The Go Programming Language Specification
Method declarations
A method is a function with a receiver. A method declaration binds an identifier, the method name, to a method, and associates the method with the receiver's base type.
Given type Point, the declarations
func (p *Point) Length() float64 {
return math.Sqrt(p.x * p.x + p.y * p.y)
}
func (p *Point) Scale(factor float64) {
p.x *= factor
p.y *= factor
}
bind the methods Length and Scale, with receiver type *Point, to the base type.
It's the method receiver.