go/ast.Decl.Pos (method)
93 uses
go/ast (current package)
ast.go#L34: Pos() token.Pos // position of first character belonging to the node
ast.go#L209: return f.Type.Pos()
ast.go#L489: return x.Type.Pos()
ast.go#L494: func (x *SelectorExpr) Pos() token.Pos { return x.X.Pos() }
ast.go#L495: func (x *IndexExpr) Pos() token.Pos { return x.X.Pos() }
ast.go#L496: func (x *IndexListExpr) Pos() token.Pos { return x.X.Pos() }
ast.go#L497: func (x *SliceExpr) Pos() token.Pos { return x.X.Pos() }
ast.go#L498: func (x *TypeAssertExpr) Pos() token.Pos { return x.X.Pos() }
ast.go#L499: func (x *CallExpr) Pos() token.Pos { return x.Fun.Pos() }
ast.go#L502: func (x *BinaryExpr) Pos() token.Pos { return x.X.Pos() }
ast.go#L503: func (x *KeyValueExpr) Pos() token.Pos { return x.Key.Pos() }
ast.go#L772: func (s *DeclStmt) Pos() token.Pos { return s.Decl.Pos() }
ast.go#L775: func (s *ExprStmt) Pos() token.Pos { return s.X.Pos() }
ast.go#L776: func (s *SendStmt) Pos() token.Pos { return s.Chan.Pos() }
ast.go#L777: func (s *IncDecStmt) Pos() token.Pos { return s.X.Pos() }
ast.go#L778: func (s *AssignStmt) Pos() token.Pos { return s.Lhs[0].Pos() }
commentmap.go#L51: pi, pj := a[i].Pos(), a[j].Pos()
commentmap.go#L109: s.pop(n.Pos())
commentmap.go#L173: qpos = fset.Position(q.Pos()) // current node position
import.go#L33: if j > i && lineAt(fset, s.Pos()) > 1+lineAt(fset, d.Specs[j-1].End()) {
import.go#L45: lastLine := lineAt(fset, lastSpec.Pos())
import.go#L112: pos[i] = posSpan{s.Pos(), s.End()}
import.go#L196: p := s.Pos()
go/doc
example.go#L370: return decls[i].Pos() < decls[j].Pos()
reader.go#L670: origPos := newField.Type.Pos()
go/parser
parser.go#L603: return nil, &ast.BadExpr{From: args[0].Pos(), To: args[0].End()}
parser.go#L609: return x, &ast.BadExpr{From: args[0].Pos(), To: args[len(args)-1].End()}
parser.go#L879: missingName = par.typ.Pos()
parser.go#L881: n.NamePos = typ.Pos() // correct position
parser.go#L1507: return &ast.BadExpr{From: args[0].Pos(), To: args[len(args)-1].End()}
parser.go#L1627: p.errorExpected(x.Pos(), "expression")
parser.go#L1628: x = &ast.BadExpr{From: x.Pos(), To: p.safePos(x.End())}
parser.go#L1651: x = &ast.BadExpr{From: x.Pos(), To: p.safePos(x.End())}
parser.go#L1716: p.error(t.Pos(), "cannot parenthesize type in composite literal")
parser.go#L1923: p.errorExpected(x[0].Pos(), "1 expression")
parser.go#L1946: return &ast.BadStmt{From: x[0].Pos(), To: colon + 1}, false
parser.go#L1969: p.errorExpected(x.Pos(), "identifier on left side of :=")
parser.go#L2058: p.error(s.Pos(), fmt.Sprintf("expected %s, found %s (missing parentheses around composite literal?)", want, found))
parser.go#L2059: return &ast.BadExpr{From: s.Pos(), To: p.safePos(s.End())}
parser.go#L2286: p.errorExpected(lhs[0].Pos(), "1 expression")
parser.go#L2298: p.errorExpected(lhs[0].Pos(), "1 or 2 expressions")
parser.go#L2313: p.errorExpected(lhs[0].Pos(), "1 expression")
parser.go#L2401: p.errorExpected(as.Lhs[len(as.Lhs)-1].Pos(), "at most 2 expressions")
resolver.go#L178: r.declErr(decl.Lhs[0].Pos(), "no new variables on left side of :=")
resolver.go#L248: r.trace("node %T@%v", node, node.Pos())
resolver.go#L358: r.openScope(n.Tag.Pos())
resolver.go#L373: r.openScope(n.Assign.Pos())
go/printer
nodes.go#L147: line := p.lineFor(list[0].Pos())
nodes.go#L156: p.print(x.Pos(), token.COMMA, blank)
nodes.go#L197: line = p.lineFor(x.Pos())
nodes.go#L247: p.print(x.Pos())
nodes.go#L769: yline := p.lineFor(x.Y.Pos())
nodes.go#L794: p.print(expr.Pos())
nodes.go#L1151: p.linebreak(p.lineFor(s.Pos()), 1, ignore, i == 0 || nindent == 0 || p.linesFrom(line) > 0)
nodes.go#L1268: var b = p.lineFor(list[0].Pos())
nodes.go#L1275: xb := p.lineFor(x.Pos())
nodes.go#L1295: p.print(stmt.Pos())
nodes.go#L1320: p.linebreak(p.lineFor(s.Stmt.Pos()), 1, ignore, true)
nodes.go#L1464: p.print(s.Value.Pos(), token.COMMA, blank)
nodes.go#L1684: p.linebreak(p.lineFor(s.Pos()), 1, ignore, p.linesFrom(line) > 0)
nodes.go#L1693: p.linebreak(p.lineFor(s.Pos()), 1, ignore, p.linesFrom(line) > 0)
nodes.go#L1748: if from := n.Pos(); from.IsValid() {
nodes.go#L1896: p.linebreak(p.lineFor(d.Pos()), min, ignore, tok == token.FUNC && p.numLines(d) > 1)
printer.go#L1092: beg := n.Pos()
go/types
assignments.go#L466: lhsVars[i] = NewVar(lhs[i].Pos(), check.pkg, "_", nil)
call.go#L86: pos = xlist[i].Pos()
check.go#L437: check.dump("%v: %s (type %s) is typed", x.Pos(), x, info.typ)
check.go#L489: pos := x.Pos()
errors.go#L261: start, end := node.Pos(), node.End()
errors.go#L285: pos := x.Pos()
expr.go#L505: check.dump("%v: found old type(%s): %s (new: %s)", x.Pos(), x, old.typ, typ)
expr.go#L1200: check.trace(e.Pos(), "expr %s", e)
expr.go#L1204: check.trace(e.Pos(), "=> %s", x)
expr.go#L1646: panic(fmt.Sprintf("%s: unknown expression type %T", check.fset.Position(e.Pos()), e))
interface.go#L169: addEmbedded(f.Type.Pos(), parseUnion(check, f.Type))
mono.go#L174: pos = xlist[i].Pos()
operand.go#L69: return x.expr.Pos()
resolver.go#L533: par = &ast.Ident{NamePos: arg.Pos(), Name: "_"}
signature.go#L310: par := NewParam(ftype.Pos(), check.pkg, "", typ)
stmt.go#L147: check.errorf(d, _DuplicateDefault, "multiple defaults (first at %s)", check.fset.Position(first.Pos()))
stmt.go#L156: scope := NewScope(check.scope, node.Pos(), node.End(), comment)
stmt.go#L459: Y := &ast.BasicLit{ValuePos: s.X.Pos(), Kind: token.INT, Value: "1"} // use x's position
stmt.go#L891: obj = NewVar(lhs.Pos(), check.pkg, "_", nil) // dummy variable
struct.go#L124: pos := f.Type.Pos()
typexpr.go#L164: tset := computeInterfaceTypeSet(check, e.Pos(), t) // TODO(gri) is this the correct position?
typexpr.go#L220: check.trace(e0.Pos(), "-- type %s", e0)
typexpr.go#L231: check.trace(e0.Pos(), "=> %s // %s", T, goTypeName(T))
typexpr.go#L233: check.trace(e0.Pos(), "=> %s (under = %s) // %s", T, under, goTypeName(T))
typexpr.go#L394: pos := ix.X.Pos()
typexpr.go#L480: pos = ix.Indices[i].Pos()
gotest.tools/v3/internal/source
source.go#L70: case fileset.Position(node.Pos()).Line == lineNum: