Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for WithStack (0.08 sec)

  1. src/cmd/vendor/golang.org/x/tools/go/ast/inspector/inspector.go

    				f(ev.node, false)
    			}
    		}
    		i++
    	}
    }
    
    // WithStack visits nodes in a similar manner to Nodes, but it
    // supplies each call to f an additional argument, the current
    // traversal stack. The stack's first element is the outermost node,
    // an *ast.File; its last is the innermost, n.
    func (in *Inspector) WithStack(types []ast.Node, f func(n ast.Node, push bool, stack []ast.Node) (proceed bool)) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jul 12 20:38:21 UTC 2023
    - 6.6K bytes
    - Viewed (0)
  2. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/httpresponse/httpresponse.go

    	// skip the traversal.
    	if !analysisutil.Imports(pass.Pkg, "net/http") {
    		return nil, nil
    	}
    
    	nodeFilter := []ast.Node{
    		(*ast.CallExpr)(nil),
    	}
    	inspect.WithStack(nodeFilter, func(n ast.Node, push bool, stack []ast.Node) bool {
    		if !push {
    			return true
    		}
    		call := n.(*ast.CallExpr)
    		if !isHTTPFuncOrMethodOnClient(pass.TypesInfo, call) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 5K bytes
    - Viewed (0)
  3. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/lostcancel/lostcancel.go

    	}
    
    	// Maps each cancel variable to its defining ValueSpec/AssignStmt.
    	cancelvars := make(map[*types.Var]ast.Node)
    
    	// TODO(adonovan): opt: refactor to make a single pass
    	// over the AST using inspect.WithStack and node types
    	// {FuncDecl,FuncLit,CallExpr,SelectorExpr}.
    
    	// Find the set of cancel vars to analyze.
    	stack := make([]ast.Node, 0, 32)
    	ast.Inspect(node, func(n ast.Node) bool {
    		switch n.(type) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 22 19:00:13 UTC 2024
    - 9K bytes
    - Viewed (0)
Back to top