Pos returns the location of the AST token most closely associated with the operation that gave rise to this instruction, or token.NoPos if it was not explicit in the source.

For each ast.Node type, a particular token is designated as the closest location for the expression, e.g. the Go token for an *ast.GoStmt. This permits a compact but approximate mapping from Instructions to source positions for use in diagnostic messages, for example.

(Do not use this position to determine which Instruction corresponds to an ast.Expr; see the notes for Value.Pos. This position may be used to determine which non-Value Instruction corresponds to some ast.Stmts, but not all: If and Jump instructions have no Pos(), for example.)

Pos is referenced in 8 repositories