go/token.Pos.IsValid (method)
50 uses
go/token (current package)
position.go#L92: func (p Pos) IsValid() bool {
go/ast
ast.go#L237: if f.Opening.IsValid() {
ast.go#L249: if f.Closing.IsValid() {
ast.go#L517: if x.Func.IsValid() || x.Params == nil { // see issue 3870
ast.go#L829: if s.Rbrace.IsValid() {
ast.go#L1011: if d.Rparen.IsValid() {
import.go#L25: if !d.Lparen.IsValid() {
resolve.go#L37: if pos := alt.Pos(); pos.IsValid() {
go/doc
reader.go#L608: if len(d.Specs) == 1 && !d.Lparen.IsValid() {
go/format
format.go#L125: if d.Lparen.IsValid() {
go/parser
parser.go#L133: if p.trace && p.pos.IsValid() {
parser.go#L636: if trailingComma.IsValid() {
parser.go#L979: if errPos.IsValid() {
parser.go#L1619: for p.tok != token.RPAREN && p.tok != token.EOF && !ellipsis.IsValid() {
parser.go#L2122: } else if semi.pos.IsValid() {
resolver.go#L149: if pos := alt.Pos(); pos.IsValid() {
go/printer
nodes.go#L498: srcIsOneLine := lbrace.IsValid() && rbrace.IsValid() && p.lineFor(lbrace) == p.lineFor(rbrace)
nodes.go#L995: if x.Ellipsis.IsValid() {
nodes.go#L999: if x.Rparen.IsValid() && p.lineFor(x.Ellipsis) < p.lineFor(x.Rparen) {
nodes.go#L1724: if s.Assign.IsValid() {
nodes.go#L1740: if d.Lparen.IsValid() || len(d.Specs) != 1 {
nodes.go#L1833: if from := n.Pos(); from.IsValid() {
nodes.go#L1834: if to := n.End(); to.IsValid() {
nodes.go#L1845: if pos1.IsValid() && pos2.IsValid() && p.lineFor(pos1) != p.lineFor(pos2) {
nodes.go#L1914: if startPos.IsValid() && p.pos.IsValid() && p.posFor(startPos).Line == p.pos.Line {
printer.go#L886: if pos.IsValid() {
go/scanner
scanner.go#L792: if s.nlPos.IsValid() {
go/types
check.go#L98: if obj := s.Lookup(name); obj != nil && (!env.exprPos.IsValid() || cmpPos(obj.scopePos(), env.exprPos) <= 0) {
decl.go#L249: alias = d.tdecl.Assign.IsValid() // package-level object
decl.go#L563: if tdecl.Assign.IsValid() {
decl.go#L757: assert(!check.objMap[obj].tdecl.Assign.IsValid()) // don't use TypeName.IsAlias (requires fully set up object)
decl.go#L790: if alt.Pos().IsValid() {
errors.go#L66: if pos := obj.Pos(); pos.IsValid() {
errors.go#L96: if p.posn.Pos().IsValid() {
errors.go#L135: if err.desc[i].posn.Pos().IsValid() {
errors.go#L166: if check.errpos != nil && check.errpos.Pos().IsValid() {
eval.go#L62: } else if !pos.IsValid() {
labels.go#L113: return varDeclPos.IsValid() && slices.Contains(badJumps, jmp)
resolver.go#L130: if pos := file.Pos(); pos.IsValid() {
resolver.go#L581: if !tdecl.Assign.IsValid() {
resolver.go#L675: if check.objMap[tname].tdecl.Assign.IsValid() {
scope2.go#L26: if obj := s.Lookup(name); obj != nil && (!pos.IsValid() || cmpPos(obj.scopePos(), pos) <= 0) {
typeset.go#L178: if !pos.IsValid() && len(ityp.methods) > 0 {
typeset.go#L243: if pos.IsValid() && !check.allowVersion(go1_14) || !Identical(m.typ, other.Type()) {
typeset.go#L276: if pos.IsValid() && check != nil && check.isImportedConstraint(typ) && !check.verifyVersionf(atPos(pos), go1_18, "embedding constraint interface %s", typ) {
typeset.go#L285: if pos.IsValid() && check != nil && !check.verifyVersionf(atPos(pos), go1_18, "embedding interface element %s", u) {
typeset.go#L299: if pos.IsValid() && check != nil && !check.verifyVersionf(atPos(pos), go1_18, "embedding non-interface type %s", typ) {
util.go#L31: func hasDots(call *ast.CallExpr) bool { return call.Ellipsis.IsValid() }