pkg go/token 中的这个函数让我想知道为什么我们需要一个返回接收器本身的方法。
// Token source positions are represented by a Position value.
// A Position is valid if the line number is > 0.
//
type Position struct {
Filename string; // filename, if any
Offset int; // byte offset, starting at 0
Line int; // line number, starting at 1
Column int; // column number, starting at 1 (character count)
}
// Pos is an accessor method for anonymous Position fields.
// It returns its receiver.
//
func (pos *Position) Pos() Position { return *pos }