- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 10 for FuncLit (0.15 sec)
-
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/testinggoroutine/util.go
id, _ := x.(*ast.Ident) return id case *ast.Ident: return fun default: return nil } } // funcLitInScope returns a FuncLit that id is at least initially assigned to. // // TODO: This is closely tied to id.Obj which is deprecated. func funcLitInScope(id *ast.Ident) *ast.FuncLit { // Compare to (*ast.Object).Pos(). if id.Obj == nil { return nil } var rhs ast.Expr switch d := id.Obj.Decl.(type) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 02:20:05 UTC 2024 - 2.4K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/lostcancel/lostcancel.go
nodeTypes := []ast.Node{ (*ast.FuncLit)(nil), (*ast.FuncDecl)(nil), } inspect.Preorder(nodeTypes, func(n ast.Node) { runFunc(pass, n) }) return nil, nil } func runFunc(pass *analysis.Pass, node ast.Node) { // Find scope of function node var funcScope *types.Scope switch v := node.(type) { case *ast.FuncLit: funcScope = pass.TypesInfo.Scopes[v.Type] case *ast.FuncDecl:
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Jan 22 19:00:13 UTC 2024 - 9K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/defers/defers.go
case *ast.CallExpr: if analysisutil.IsFunctionNamed(typeutil.StaticCallee(pass.TypesInfo, v), "time", "Since") { pass.Reportf(v.Pos(), "call to time.Since is not deferred") } case *ast.FuncLit: return false // prune } return true } inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) nodeFilter := []ast.Node{ (*ast.DeferStmt)(nil), }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 23:33:33 UTC 2023 - 1.4K bytes - Viewed (0) -
src/cmd/compile/internal/syntax/positions.go
// case *BadExpr: // case *Name: // case *BasicLit: case *CompositeLit: if n.Type != nil { m = n.Type continue } return n.Pos() case *KeyValueExpr: m = n.Key // case *FuncLit: // case *ParenExpr: case *SelectorExpr: m = n.X case *IndexExpr: m = n.X // case *SliceExpr: case *AssertExpr: m = n.X case *TypeSwitchGuard: if n.Lhs != nil { m = n.Lhs
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Jun 10 17:49:19 UTC 2024 - 6.5K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/testinggoroutine/testinggoroutine.go
forbidden := formatMethod(sel, fn) // e.g. "(*testing.T).Forbidden var context string var where analysis.Range = e.async // Put the report at the go fun() or t.Run(name, fun). if _, local := e.fun.(*ast.FuncLit); local { where = call // Put the report at the t.Forbidden() call. } else if id, ok := e.fun.(*ast.Ident); ok { context = fmt.Sprintf(" (%s calls %s)", id.Name, forbidden) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 02:20:05 UTC 2024 - 7.8K bytes - Viewed (0) -
src/go/types/exprstring.go
buf.WriteString(x.Name) case *ast.Ellipsis: buf.WriteString("...") if x.Elt != nil { WriteExpr(buf, x.Elt) } case *ast.BasicLit: buf.WriteString(x.Value) case *ast.FuncLit: buf.WriteByte('(') WriteExpr(buf, x.Type) buf.WriteString(" literal)") // shortened case *ast.CompositeLit: WriteExpr(buf, x.Type) buf.WriteByte('{') if len(x.Elts) > 0 { buf.WriteString("…")
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Feb 08 19:31:44 UTC 2024 - 4.8K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/ast/inspector/typeof.go
case *ast.FieldList: return 1 << nFieldList case *ast.File: return 1 << nFile case *ast.ForStmt: return 1 << nForStmt case *ast.FuncDecl: return 1 << nFuncDecl case *ast.FuncLit: return 1 << nFuncLit case *ast.FuncType: return 1 << nFuncType case *ast.GenDecl: return 1 << nGenDecl case *ast.GoStmt: return 1 << nGoStmt case *ast.Ident: return 1 << nIdent
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Dec 18 21:28:13 UTC 2023 - 4.8K bytes - Viewed (0) -
src/go/ast/walk.go
} case *FieldList: walkList(v, n.List) // Expressions case *BadExpr, *Ident, *BasicLit: // nothing to do case *Ellipsis: if n.Elt != nil { Walk(v, n.Elt) } case *FuncLit: Walk(v, n.Type) Walk(v, n.Body) case *CompositeLit: if n.Type != nil { Walk(v, n.Type) } walkList(v, n.Elts) case *ParenExpr: Walk(v, n.X) case *SelectorExpr:
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 16 16:34:10 UTC 2024 - 6.4K bytes - Viewed (0) -
src/cmd/compile/internal/syntax/nodes.go
NKeys int // number of elements with keys Rbrace Pos expr } // Key: Value KeyValueExpr struct { Key, Value Expr expr } // func Type { Body } FuncLit struct { Type *FuncType Body *BlockStmt expr } // (X) ParenExpr struct { X Expr expr } // X.Sel SelectorExpr struct { X Expr Sel *Name expr
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Sep 20 14:52:38 UTC 2023 - 9K bytes - Viewed (0) -
src/cmd/compile/internal/syntax/nodes_test.go
{"BasicLit", "@`abc`"}, {"CompositeLit", `@{}`}, {"CompositeLit", `T@{}`}, {"CompositeLit", `struct{x, y int}@{}`}, {"KeyValueExpr", `"foo"@: true`}, {"KeyValueExpr", `"a"@: b`}, {"FuncLit", `@func (){}`}, {"ParenExpr", `@(x)`}, {"SelectorExpr", `a@.b`}, {"IndexExpr", `a@[i]`}, {"SliceExpr", `a@[:]`}, {"SliceExpr", `a@[i:]`}, {"SliceExpr", `a@[:j]`}, {"SliceExpr", `a@[i:j]`},
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Nov 02 18:45:06 UTC 2023 - 8.7K bytes - Viewed (0)