func (r *definitionResult) toSerial(res *serial.Result, fset *token.FileSet) { definition := &serial.Definition{ Desc: r.descr, ObjPos: fset.Position(r.pos).String(), } res.Definition = definition }
func (r *definitionResult) toSerial(res *serial.Result, fset *token.FileSet) { definition := &serial.Definition{ Desc: r.obj.String(), } if pos := r.obj.Pos(); pos != token.NoPos { // Package objects have no Pos() definition.ObjPos = fset.Position(pos).String() } res.Definition = definition }