type go/token.Pos
360 uses
go/token (current package)
position.go#L83: type Pos int
position.go#L89: const NoPos Pos = 0
position.go#L92: func (p Pos) IsValid() bool {
position.go#L225: func (f *File) LineStart(line int) Pos {
position.go#L234: return Pos(f.base + f.lines[line-1])
position.go#L302: func (f *File) Pos(offset int) Pos {
position.go#L303: return Pos(f.base + f.fixOffset(offset))
position.go#L315: func (f *File) Offset(p Pos) int {
position.go#L321: func (f *File) Line(p Pos) int {
position.go#L375: func (f *File) position(p Pos, adjusted bool) (pos Position) {
position.go#L387: func (f *File) PositionFor(p Pos, adjusted bool) (pos Position) {
position.go#L397: func (f *File) Position(p Pos) (pos Position) {
position.go#L539: func (s *FileSet) file(p Pos) *File {
position.go#L565: func (s *FileSet) File(p Pos) (f *File) {
position.go#L576: func (s *FileSet) PositionFor(p Pos, adjusted bool) (pos Position) {
position.go#L587: func (s *FileSet) Position(p Pos) (pos Position) {
go/ast
ast.go#L33: Pos() token.Pos // position of first character belonging to the node
ast.go#L34: End() token.Pos // position of first character immediately after the node
ast.go#L65: Slash token.Pos // position of "/" starting the comment
ast.go#L69: func (c *Comment) Pos() token.Pos { return c.Slash }
ast.go#L70: func (c *Comment) End() token.Pos { return token.Pos(int(c.Slash) + len(c.Text)) }
ast.go#L78: func (g *CommentGroup) Pos() token.Pos { return g.List[0].Pos() }
ast.go#L79: func (g *CommentGroup) End() token.Pos { return g.List[len(g.List)-1].End() }
ast.go#L205: func (f *Field) Pos() token.Pos {
ast.go#L215: func (f *Field) End() token.Pos {
ast.go#L231: Opening token.Pos // position of opening parenthesis/brace/bracket, if any
ast.go#L233: Closing token.Pos // position of closing parenthesis/brace/bracket, if any
ast.go#L236: func (f *FieldList) Pos() token.Pos {
ast.go#L248: func (f *FieldList) End() token.Pos {
ast.go#L283: From, To token.Pos // position range of bad expression
ast.go#L288: NamePos token.Pos // identifier position
ast.go#L297: Ellipsis token.Pos // position of "..."
ast.go#L315: ValuePos token.Pos // literal position
ast.go#L329: Lbrace token.Pos // position of "{"
ast.go#L331: Rbrace token.Pos // position of "}"
ast.go#L337: Lparen token.Pos // position of "("
ast.go#L339: Rparen token.Pos // position of ")"
ast.go#L351: Lbrack token.Pos // position of "["
ast.go#L353: Rbrack token.Pos // position of "]"
ast.go#L360: Lbrack token.Pos // position of "["
ast.go#L362: Rbrack token.Pos // position of "]"
ast.go#L368: Lbrack token.Pos // position of "["
ast.go#L373: Rbrack token.Pos // position of "]"
ast.go#L381: Lparen token.Pos // position of "("
ast.go#L383: Rparen token.Pos // position of ")"
ast.go#L389: Lparen token.Pos // position of "("
ast.go#L391: Ellipsis token.Pos // position of "..." (token.NoPos if there is no "...")
ast.go#L392: Rparen token.Pos // position of ")"
ast.go#L399: Star token.Pos // position of "*"
ast.go#L407: OpPos token.Pos // position of Op
ast.go#L415: OpPos token.Pos // position of Op
ast.go#L425: Colon token.Pos // position of ":"
ast.go#L445: Lbrack token.Pos // position of "["
ast.go#L452: Struct token.Pos // position of "struct" keyword
ast.go#L461: Func token.Pos // position of "func" keyword (token.NoPos if there is no "func")
ast.go#L469: Interface token.Pos // position of "interface" keyword
ast.go#L476: Map token.Pos // position of "map" keyword
ast.go#L483: Begin token.Pos // position of "chan" keyword or "<-" (whichever comes first)
ast.go#L484: Arrow token.Pos // position of "<-" (token.NoPos if there is no "<-")
ast.go#L492: func (x *BadExpr) Pos() token.Pos { return x.From }
ast.go#L493: func (x *Ident) Pos() token.Pos { return x.NamePos }
ast.go#L494: func (x *Ellipsis) Pos() token.Pos { return x.Ellipsis }
ast.go#L495: func (x *BasicLit) Pos() token.Pos { return x.ValuePos }
ast.go#L496: func (x *FuncLit) Pos() token.Pos { return x.Type.Pos() }
ast.go#L497: func (x *CompositeLit) Pos() token.Pos {
ast.go#L503: func (x *ParenExpr) Pos() token.Pos { return x.Lparen }
ast.go#L504: func (x *SelectorExpr) Pos() token.Pos { return x.X.Pos() }
ast.go#L505: func (x *IndexExpr) Pos() token.Pos { return x.X.Pos() }
ast.go#L506: func (x *IndexListExpr) Pos() token.Pos { return x.X.Pos() }
ast.go#L507: func (x *SliceExpr) Pos() token.Pos { return x.X.Pos() }
ast.go#L508: func (x *TypeAssertExpr) Pos() token.Pos { return x.X.Pos() }
ast.go#L509: func (x *CallExpr) Pos() token.Pos { return x.Fun.Pos() }
ast.go#L510: func (x *StarExpr) Pos() token.Pos { return x.Star }
ast.go#L511: func (x *UnaryExpr) Pos() token.Pos { return x.OpPos }
ast.go#L512: func (x *BinaryExpr) Pos() token.Pos { return x.X.Pos() }
ast.go#L513: func (x *KeyValueExpr) Pos() token.Pos { return x.Key.Pos() }
ast.go#L514: func (x *ArrayType) Pos() token.Pos { return x.Lbrack }
ast.go#L515: func (x *StructType) Pos() token.Pos { return x.Struct }
ast.go#L516: func (x *FuncType) Pos() token.Pos {
ast.go#L522: func (x *InterfaceType) Pos() token.Pos { return x.Interface }
ast.go#L523: func (x *MapType) Pos() token.Pos { return x.Map }
ast.go#L524: func (x *ChanType) Pos() token.Pos { return x.Begin }
ast.go#L526: func (x *BadExpr) End() token.Pos { return x.To }
ast.go#L527: func (x *Ident) End() token.Pos { return token.Pos(int(x.NamePos) + len(x.Name)) }
ast.go#L528: func (x *Ellipsis) End() token.Pos {
ast.go#L534: func (x *BasicLit) End() token.Pos { return token.Pos(int(x.ValuePos) + len(x.Value)) }
ast.go#L535: func (x *FuncLit) End() token.Pos { return x.Body.End() }
ast.go#L536: func (x *CompositeLit) End() token.Pos { return x.Rbrace + 1 }
ast.go#L537: func (x *ParenExpr) End() token.Pos { return x.Rparen + 1 }
ast.go#L538: func (x *SelectorExpr) End() token.Pos { return x.Sel.End() }
ast.go#L539: func (x *IndexExpr) End() token.Pos { return x.Rbrack + 1 }
ast.go#L540: func (x *IndexListExpr) End() token.Pos { return x.Rbrack + 1 }
ast.go#L541: func (x *SliceExpr) End() token.Pos { return x.Rbrack + 1 }
ast.go#L542: func (x *TypeAssertExpr) End() token.Pos { return x.Rparen + 1 }
ast.go#L543: func (x *CallExpr) End() token.Pos { return x.Rparen + 1 }
ast.go#L544: func (x *StarExpr) End() token.Pos { return x.X.End() }
ast.go#L545: func (x *UnaryExpr) End() token.Pos { return x.X.End() }
ast.go#L546: func (x *BinaryExpr) End() token.Pos { return x.Y.End() }
ast.go#L547: func (x *KeyValueExpr) End() token.Pos { return x.Value.End() }
ast.go#L548: func (x *ArrayType) End() token.Pos { return x.Elt.End() }
ast.go#L549: func (x *StructType) End() token.Pos { return x.Fields.End() }
ast.go#L550: func (x *FuncType) End() token.Pos {
ast.go#L556: func (x *InterfaceType) End() token.Pos { return x.Methods.End() }
ast.go#L557: func (x *MapType) End() token.Pos { return x.Value.End() }
ast.go#L558: func (x *ChanType) End() token.Pos { return x.Value.End() }
ast.go#L618: From, To token.Pos // position range of bad statement
ast.go#L631: Semicolon token.Pos // position of following ";"
ast.go#L638: Colon token.Pos // position of ":"
ast.go#L652: Arrow token.Pos // position of "<-"
ast.go#L659: TokPos token.Pos // position of Tok
ast.go#L668: TokPos token.Pos // position of Tok
ast.go#L675: Go token.Pos // position of "go" keyword
ast.go#L681: Defer token.Pos // position of "defer" keyword
ast.go#L687: Return token.Pos // position of "return" keyword
ast.go#L695: TokPos token.Pos // position of Tok
ast.go#L702: Lbrace token.Pos // position of "{"
ast.go#L704: Rbrace token.Pos // position of "}", if any (may be absent due to syntax error)
ast.go#L709: If token.Pos // position of "if" keyword
ast.go#L718: Case token.Pos // position of "case" or "default" keyword
ast.go#L720: Colon token.Pos // position of ":"
ast.go#L726: Switch token.Pos // position of "switch" keyword
ast.go#L734: Switch token.Pos // position of "switch" keyword
ast.go#L742: Case token.Pos // position of "case" or "default" keyword
ast.go#L744: Colon token.Pos // position of ":"
ast.go#L750: Select token.Pos // position of "select" keyword
ast.go#L756: For token.Pos // position of "for" keyword
ast.go#L765: For token.Pos // position of "for" keyword
ast.go#L767: TokPos token.Pos // position of Tok; invalid if Key == nil
ast.go#L769: Range token.Pos // position of "range" keyword
ast.go#L777: func (s *BadStmt) Pos() token.Pos { return s.From }
ast.go#L778: func (s *DeclStmt) Pos() token.Pos { return s.Decl.Pos() }
ast.go#L779: func (s *EmptyStmt) Pos() token.Pos { return s.Semicolon }
ast.go#L780: func (s *LabeledStmt) Pos() token.Pos { return s.Label.Pos() }
ast.go#L781: func (s *ExprStmt) Pos() token.Pos { return s.X.Pos() }
ast.go#L782: func (s *SendStmt) Pos() token.Pos { return s.Chan.Pos() }
ast.go#L783: func (s *IncDecStmt) Pos() token.Pos { return s.X.Pos() }
ast.go#L784: func (s *AssignStmt) Pos() token.Pos { return s.Lhs[0].Pos() }
ast.go#L785: func (s *GoStmt) Pos() token.Pos { return s.Go }
ast.go#L786: func (s *DeferStmt) Pos() token.Pos { return s.Defer }
ast.go#L787: func (s *ReturnStmt) Pos() token.Pos { return s.Return }
ast.go#L788: func (s *BranchStmt) Pos() token.Pos { return s.TokPos }
ast.go#L789: func (s *BlockStmt) Pos() token.Pos { return s.Lbrace }
ast.go#L790: func (s *IfStmt) Pos() token.Pos { return s.If }
ast.go#L791: func (s *CaseClause) Pos() token.Pos { return s.Case }
ast.go#L792: func (s *SwitchStmt) Pos() token.Pos { return s.Switch }
ast.go#L793: func (s *TypeSwitchStmt) Pos() token.Pos { return s.Switch }
ast.go#L794: func (s *CommClause) Pos() token.Pos { return s.Case }
ast.go#L795: func (s *SelectStmt) Pos() token.Pos { return s.Select }
ast.go#L796: func (s *ForStmt) Pos() token.Pos { return s.For }
ast.go#L797: func (s *RangeStmt) Pos() token.Pos { return s.For }
ast.go#L799: func (s *BadStmt) End() token.Pos { return s.To }
ast.go#L800: func (s *DeclStmt) End() token.Pos { return s.Decl.End() }
ast.go#L801: func (s *EmptyStmt) End() token.Pos {
ast.go#L807: func (s *LabeledStmt) End() token.Pos { return s.Stmt.End() }
ast.go#L808: func (s *ExprStmt) End() token.Pos { return s.X.End() }
ast.go#L809: func (s *SendStmt) End() token.Pos { return s.Value.End() }
ast.go#L810: func (s *IncDecStmt) End() token.Pos {
ast.go#L813: func (s *AssignStmt) End() token.Pos { return s.Rhs[len(s.Rhs)-1].End() }
ast.go#L814: func (s *GoStmt) End() token.Pos { return s.Call.End() }
ast.go#L815: func (s *DeferStmt) End() token.Pos { return s.Call.End() }
ast.go#L816: func (s *ReturnStmt) End() token.Pos {
ast.go#L822: func (s *BranchStmt) End() token.Pos {
ast.go#L826: return token.Pos(int(s.TokPos) + len(s.Tok.String()))
ast.go#L828: func (s *BlockStmt) End() token.Pos {
ast.go#L837: func (s *IfStmt) End() token.Pos {
ast.go#L843: func (s *CaseClause) End() token.Pos {
ast.go#L849: func (s *SwitchStmt) End() token.Pos { return s.Body.End() }
ast.go#L850: func (s *TypeSwitchStmt) End() token.Pos { return s.Body.End() }
ast.go#L851: func (s *CommClause) End() token.Pos {
ast.go#L857: func (s *SelectStmt) End() token.Pos { return s.Body.End() }
ast.go#L858: func (s *ForStmt) End() token.Pos { return s.Body.End() }
ast.go#L859: func (s *RangeStmt) End() token.Pos { return s.Body.End() }
ast.go#L903: EndPos token.Pos // end of spec (overrides Path.Pos if nonzero)
ast.go#L922: Assign token.Pos // position of '=', if any
ast.go#L930: func (s *ImportSpec) Pos() token.Pos {
ast.go#L936: func (s *ValueSpec) Pos() token.Pos { return s.Names[0].Pos() }
ast.go#L937: func (s *TypeSpec) Pos() token.Pos { return s.Name.Pos() }
ast.go#L939: func (s *ImportSpec) End() token.Pos {
ast.go#L946: func (s *ValueSpec) End() token.Pos {
ast.go#L955: func (s *TypeSpec) End() token.Pos { return s.Type.End() }
ast.go#L970: From, To token.Pos // position range of bad declaration
ast.go#L986: TokPos token.Pos // position of Tok
ast.go#L988: Lparen token.Pos // position of '(', if any
ast.go#L990: Rparen token.Pos // position of ')', if any
ast.go#L1005: func (d *BadDecl) Pos() token.Pos { return d.From }
ast.go#L1006: func (d *GenDecl) Pos() token.Pos { return d.TokPos }
ast.go#L1007: func (d *FuncDecl) Pos() token.Pos { return d.Type.Pos() }
ast.go#L1009: func (d *BadDecl) End() token.Pos { return d.To }
ast.go#L1010: func (d *GenDecl) End() token.Pos {
ast.go#L1016: func (d *FuncDecl) End() token.Pos {
ast.go#L1055: Package token.Pos // position of "package" keyword
ast.go#L1059: FileStart, FileEnd token.Pos // start and end of entire file
ast.go#L1071: func (f *File) Pos() token.Pos { return f.Package }
ast.go#L1077: func (f *File) End() token.Pos {
ast.go#L1095: func (p *Package) Pos() token.Pos { return token.NoPos }
ast.go#L1096: func (p *Package) End() token.Pos { return token.NoPos }
commentmap.go#L102: func (s *nodeStack) pop(pos token.Pos) (top Node) {
filter.go#L343: var minPos, maxPos token.Pos
filter.go#L367: var pos token.Pos
import.go#L66: func lineAt(fset *token.FileSet, pos token.Pos) int {
import.go#L103: Start token.Pos
import.go#L104: End token.Pos
import.go#L132: var end token.Pos
print.go#L244: case token.Pos:
resolve.go#L21: func (p *pkgBuilder) error(pos token.Pos, msg string) {
resolve.go#L25: func (p *pkgBuilder) errorf(pos token.Pos, format string, args ...any) {
scope.go#L103: func (obj *Object) Pos() token.Pos {
go/build
build.go#L1441: pos token.Pos
go/doc
doc.go#L94: Pos, End token.Pos // position range of the comment containing the marker
example.go#L205: groupStart := func(s *ast.ImportSpec) token.Pos {
example.go#L509: func findImportGroupStarts(imps []*ast.ImportSpec) []token.Pos {
example.go#L511: groupStarts := make([]token.Pos, len(startImps))
example.go#L530: prevEnd := token.Pos(-2)
exports.go#L253: func copyConstType(typ ast.Expr, pos token.Pos) ast.Expr {
go/parser
interface.go#L122: f.FileStart = token.Pos(file.Base())
interface.go#L123: f.FileEnd = token.Pos(file.Base() + file.Size())
parser.go#L46: pos token.Pos // token position
parser.go#L54: syncPos token.Pos // last synchronization position
parser.go#L256: pos token.Pos
parser.go#L260: func (p *parser) error(pos token.Pos, msg string) {
parser.go#L283: func (p *parser) errorExpected(pos token.Pos, msg string) {
parser.go#L301: func (p *parser) expect(tok token.Token) token.Pos {
parser.go#L312: func (p *parser) expect2(tok token.Token) (pos token.Pos) {
parser.go#L324: func (p *parser) expectClosing(tok token.Token, context string) token.Pos {
parser.go#L453: func (p *parser) safePos(pos token.Pos) (res token.Pos) {
parser.go#L456: res = token.Pos(p.file.Base() + p.file.Size()) // EOF position
parser.go#L573: func (p *parser) parseArrayType(lbrack token.Pos, len ast.Expr) *ast.ArrayType {
parser.go#L944: var errPos token.Pos
parser.go#L960: var errPos token.Pos // left-most error position (or invalid)
parser.go#L1307: var arrow token.Pos
parser.go#L1550: var colons [N - 1]token.Pos
parser.go#L1618: var ellipsis token.Pos
parser.go#L2101: pos token.Pos
parser.go#L2570: func (p *parser) parseGenericType(spec *ast.TypeSpec, openPos token.Pos, name0 *ast.Ident, typ0 ast.Expr) {
parser.go#L2740: var lparen, rparen token.Pos
parser.go#L2912: var declErr func(token.Pos, string)
parser.go#L2924: func packIndexExpr(x ast.Expr, lbrack token.Pos, exprs []ast.Expr, rbrack token.Pos) ast.Expr {
resolver.go#L21: func resolveFile(file *ast.File, handle *token.File, declErr func(token.Pos, string)) {
resolver.go#L49: pos := ident.Obj.Decl.(interface{ Pos() token.Pos }).Pos()
resolver.go#L61: declErr func(token.Pos, string)
resolver.go#L82: case token.Pos:
resolver.go#L89: func (r *resolver) openScope(pos token.Pos) {
go/printer
nodes.go#L126: func (p *printer) exprList(prev0 token.Pos, list []ast.Expr, depth int, mode exprListMode, next0 token.Pos, isIncomplete bool) {
nodes.go#L1913: func (p *printer) distanceFrom(startPos token.Pos, startOutCol int) int {
printer.go#L95: cachedPos token.Pos
printer.go#L184: func (p *printer) posFor(pos token.Pos) token.Position {
printer.go#L189: func (p *printer) lineFor(pos token.Pos) int {
printer.go#L885: func (p *printer) setPos(pos token.Pos) {
go/scanner
scanner.go#L43: nlPos token.Pos // position of newline in preceding comment
scanner.go#L790: func (s *Scanner) Scan() (pos token.Pos, tok token.Token, lit string) {
go/types
alias.go#L165: func (check *Checker) newAliasInstance(pos token.Pos, orig *Alias, targs []Type, expanding *Named, ctxt *Context) *Alias {
api.go#L48: Pos token.Pos // error position
api.go#L58: go116start token.Pos
api.go#L59: go116end token.Pos
call.go#L35: func (check *Checker) funcInst(T *target, pos token.Pos, x *operand, ix *indexedExpr, infer bool) ([]Type, []ast.Expr) {
call.go#L133: func (check *Checker) instantiateSignature(pos token.Pos, expr ast.Expr, typ *Signature, targs []Type, xlist []ast.Expr) (res *Signature) {
check.go#L20: var nopos token.Pos
check.go#L85: exprPos token.Pos // if valid, identifiers are looked up as if at position pos (used by CheckExpr, Eval)
const.go#L22: func (check *Checker) overflow(x *operand, opPos token.Pos) {
decl.go#L17: func (check *Checker) declare(scope *Scope, id *ast.Ident, obj Object, pos token.Pos) {
decl.go#L734: func (check *Checker) declareTypeParam(name *ast.Ident, scopePos token.Pos) *TypeParam {
errors.go#L231: Pos() token.Pos
errors.go#L261: type atPos token.Pos
errors.go#L263: func (s atPos) Pos() token.Pos {
errors.go#L264: return token.Pos(s)
errors.go#L273: start, pos, end token.Pos
errors.go#L276: func (e posSpan) Pos() token.Pos {
errors.go#L283: func inNode(node ast.Node, pos token.Pos) posSpan {
eval.go#L24: func Eval(fset *token.FileSet, pkg *Package, pos token.Pos, expr string) (_ TypeAndValue, err error) {
eval.go#L56: func CheckExpr(fset *token.FileSet, pkg *Package, pos token.Pos, expr ast.Expr, info *Info) (err error) {
expr.go#L88: func opPos(x ast.Expr) token.Pos {
expr.go#L753: func (check *Checker) binary(x *operand, e ast.Expr, lhs, rhs ast.Expr, op token.Token, opPos token.Pos) {
format.go#L27: case token.Pos:
format.go#L90: func (check *Checker) trace(pos token.Pos, format string, args ...any) {
index.go#L424: lbrack token.Pos // position of "["
index.go#L426: rbrack token.Pos // position of "]"
index.go#L429: func (x *indexedExpr) Pos() token.Pos {
infer.go#L471: func (check *Checker) renameTParams(pos token.Pos, tparams []*TypeParam, typ Type) ([]*TypeParam, Type) {
instantiate.go#L91: func (check *Checker) instance(pos token.Pos, orig genericType, targs []Type, expanding *Named, ctxt *Context) (res Type) {
instantiate.go#L191: func (check *Checker) validateTArgLen(pos token.Pos, name string, want, got int) bool {
instantiate.go#L212: func (check *Checker) verify(pos token.Pos, tparams []*TypeParam, targs []Type, ctxt *Context) (int, error) {
interface.go#L21: embedPos *[]token.Pos // positions of embedded elements; or nil (for error messages) - use pointer to save space
interface.go#L160: addEmbedded := func(pos token.Pos, typ Type) {
interface.go#L163: ityp.embedPos = new([]token.Pos)
labels.go#L100: varDeclPos token.Pos
labels.go#L107: recordVarDecl := func(pos token.Pos) {
mono.go#L82: pos token.Pos
mono.go#L176: func (w *monoGraph) recordInstance(pkg *Package, pos token.Pos, tparams []*TypeParam, targs []Type, xlist []ast.Expr) {
mono.go#L187: func (w *monoGraph) assign(pkg *Package, pos token.Pos, tpar *TypeParam, targ Type) {
mono.go#L332: func (w *monoGraph) addEdge(dst, src, weight int, pos token.Pos, typ Type) {
named.go#L261: func (check *Checker) newNamedInstance(pos token.Pos, orig *Named, targs []Type, expanding *Named) *Named {
object.go#L31: Pos() token.Pos // position of object identifier in declaration
object.go#L69: scopePos() token.Pos
object.go#L72: setScopePos(pos token.Pos)
object.go#L103: pos token.Pos
object.go#L109: scopePos_ token.Pos
object.go#L148: func (obj *object) Pos() token.Pos { return obj.pos }
object.go#L171: func (obj *object) scopePos() token.Pos { return obj.scopePos_ }
object.go#L177: func (obj *object) setScopePos(pos token.Pos) { obj.scopePos_ = pos }
object.go#L252: func NewPkgName(pos token.Pos, pkg *Package, name string, imported *Package) *PkgName {
object.go#L268: func NewConst(pos token.Pos, pkg *Package, name string, typ Type, val constant.Value) *Const {
object.go#L293: func NewTypeName(pos token.Pos, pkg *Package, name string, typ Type) *TypeName {
object.go#L299: func _NewTypeNameLazy(pos token.Pos, pkg *Package, name string, load func(named *Named) (tparams []*TypeParam, underlying Type, methods []*Func)) *TypeName {
object.go#L344: func NewVar(pos token.Pos, pkg *Package, name string, typ Type) *Var {
object.go#L349: func NewParam(pos token.Pos, pkg *Package, name string, typ Type) *Var {
object.go#L356: func NewField(pos token.Pos, pkg *Package, name string, typ Type, embedded bool) *Var {
object.go#L397: func NewFunc(pos token.Pos, pkg *Package, name string, sig *Signature) *Func {
object.go#L488: func NewLabel(pos token.Pos, pkg *Package, name string) *Label {
operand.go#L69: func (x *operand) Pos() token.Pos {
resolver.go#L250: pos, end = token.Pos(f.Base()), token.Pos(f.Base()+f.Size())
scope.go#L30: pos, end token.Pos // scope extent; may be invalid
scope.go#L37: func NewScope(parent *Scope, pos, end token.Pos, comment string) *Scope {
scope.go#L202: func (*lazyObject) Pos() token.Pos { panic("unreachable") }
scope.go#L216: func (*lazyObject) scopePos() token.Pos { panic("unreachable") }
scope.go#L217: func (*lazyObject) setScopePos(token.Pos) { panic("unreachable") }
scope2.go#L24: func (s *Scope) LookupParent(name string, pos token.Pos) (*Scope, Object) {
scope2.go#L37: func (s *Scope) Pos() token.Pos { return s.pos }
scope2.go#L38: func (s *Scope) End() token.Pos { return s.end }
scope2.go#L43: func (s *Scope) Contains(pos token.Pos) bool {
scope2.go#L52: func (s *Scope) Innermost(pos token.Pos) *Scope {
signature.go#L162: func (check *Checker) collectRecv(rparam *ast.Field, scopePos token.Pos) (*Var, *TypeParamList) {
signature.go#L415: func (check *Checker) declareParams(names []*ast.Ident, params []*Var, scopePos token.Pos) {
stmt.go#L230: pos token.Pos
struct.go#L200: func (check *Checker) declareInSet(oset *objset, pos token.Pos, obj Object) bool {
subst.go#L58: func (check *Checker) subst(pos token.Pos, typ Type, smap substMap, expanding *Named, ctxt *Context) Type {
subst.go#L85: pos token.Pos
typeset.go#L155: func computeInterfaceTypeSet(check *Checker, pos token.Pos, ityp *Interface) *_TypeSet {
typeset.go#L222: mpos := make(map[*Func]token.Pos) // method specification or method embedding position, for good error messages
typeset.go#L223: addMethod := func(pos token.Pos, m *Func, explicit bool) {
typeset.go#L264: var pos token.Pos // embedding position
typeset.go#L375: func computeUnionTypeSet(check *Checker, unionSets map[*Union]*_TypeSet, pos token.Pos, utyp *Union) *_TypeSet {
util.go#L28: func cmpPos(p, q token.Pos) int { return int(p - q) }
util.go#L50: func startPos(n ast.Node) token.Pos { return n.Pos() }
util.go#L53: func endPos(n ast.Node) token.Pos { return n.End() }
validtype.go#L30: func (check *Checker) validType0(pos token.Pos, typ Type, nest, path []*Named) bool {
golang.org/x/tools/internal/aliases
aliases.go#L28: func NewAlias(enabled bool, pos token.Pos, pkg *types.Package, name string, rhs types.Type, tparams []*types.TypeParam) *types.TypeName {
golang.org/x/tools/internal/gcimporter
bimport.go#L36: func (s *fakeFileSet) pos(file string, line, column int) token.Pos {
bimport.go#L56: return token.Pos(f.file.Base() + line - 1)
iexport.go#L643: func (p *iexporter) fileIndexAndOffset(file *token.File, pos token.Pos) (uint64, uint64) {
iexport.go#L854: func (w *exportWriter) pos(pos token.Pos) {
iexport.go#L868: func (w *exportWriter) posV2(pos token.Pos) {
iexport.go#L879: func (w *exportWriter) posV1(pos token.Pos) {
iexport.go#L913: func (w *exportWriter) posV0(pos token.Pos) {
iimport.go#L814: func (r *importReader) pos() token.Pos {
iimport.go#L855: func (r *importReader) posv2() token.Pos {
ureader_yes.go#L196: func (r *reader) pos() token.Pos {
golang.org/x/tools/internal/typeparams
common.go#L30: func UnpackIndexExpr(n ast.Node) (x ast.Expr, lbrack token.Pos, indices []ast.Expr, rbrack token.Pos) {
common.go#L43: func PackIndexExpr(x ast.Expr, lbrack token.Pos, indices []ast.Expr, rbrack token.Pos) ast.Expr {
golang.org/x/tools/internal/typesinternal
types.go#L43: func ErrorCodeStartEnd(err types.Error) (code ErrorCode, start, end token.Pos, ok bool) {
types.go#L54: return ErrorCode(data[0]), token.Pos(data[1]), token.Pos(data[2]), true