Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 23 for DeferStmt (0.72 sec)

  1. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/defers/defers.go

    			return false // prune
    		}
    		return true
    	}
    
    	inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector)
    
    	nodeFilter := []ast.Node{
    		(*ast.DeferStmt)(nil),
    	}
    
    	inspect.Preorder(nodeFilter, func(n ast.Node) {
    		d := n.(*ast.DeferStmt)
    		ast.Inspect(d.Call, checkDeferCall)
    	})
    
    	return nil, 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)
  2. src/go/types/return.go

    	switch s := s.(type) {
    	default:
    		panic("unreachable")
    
    	case *ast.BadStmt, *ast.DeclStmt, *ast.EmptyStmt, *ast.SendStmt,
    		*ast.IncDecStmt, *ast.AssignStmt, *ast.GoStmt, *ast.DeferStmt,
    		*ast.RangeStmt:
    		// no chance
    
    	case *ast.LabeledStmt:
    		return check.isTerminating(s.Stmt, s.Label.Name)
    
    	case *ast.ExprStmt:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 22 19:32:17 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  3. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/unreachable/unreachable.go

    	switch x := stmt.(type) {
    	default:
    		log.Fatalf("%s: internal error in findLabels: unexpected statement %T", d.pass.Fset.Position(x.Pos()), x)
    
    	case *ast.AssignStmt,
    		*ast.BadStmt,
    		*ast.DeclStmt,
    		*ast.DeferStmt,
    		*ast.EmptyStmt,
    		*ast.ExprStmt,
    		*ast.GoStmt,
    		*ast.IncDecStmt,
    		*ast.ReturnStmt,
    		*ast.SendStmt:
    		// no statements inside
    
    	case *ast.BlockStmt:
    		for _, stmt := range x.List {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 09 01:28:01 UTC 2023
    - 7.6K bytes
    - Viewed (0)
  4. src/cmd/vendor/golang.org/x/tools/go/ast/inspector/typeof.go

    	case *ast.Comment:
    		return 1 << nComment
    	case *ast.CommentGroup:
    		return 1 << nCommentGroup
    	case *ast.CompositeLit:
    		return 1 << nCompositeLit
    	case *ast.DeclStmt:
    		return 1 << nDeclStmt
    	case *ast.DeferStmt:
    		return 1 << nDeferStmt
    	case *ast.Ellipsis:
    		return 1 << nEllipsis
    	case *ast.EmptyStmt:
    		return 1 << nEmptyStmt
    	case *ast.ExprStmt:
    		return 1 << nExprStmt
    	case *ast.Field:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 4.8K bytes
    - Viewed (0)
  5. src/go/ast/ast.go

    		Rhs    []Expr
    	}
    
    	// A GoStmt node represents a go statement.
    	GoStmt struct {
    		Go   token.Pos // position of "go" keyword
    		Call *CallExpr
    	}
    
    	// A DeferStmt node represents a defer statement.
    	DeferStmt struct {
    		Defer token.Pos // position of "defer" keyword
    		Call  *CallExpr
    	}
    
    	// A ReturnStmt node represents a return statement.
    	ReturnStmt struct {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 28 21:32:41 UTC 2024
    - 35.6K bytes
    - Viewed (0)
  6. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/httpresponse/httpresponse.go

    		}
    
    		resp := rootIdent(asg.Lhs[0])
    		if resp == nil {
    			return true // could not find the http.Response in the assignment.
    		}
    
    		def, ok := stmts[1].(*ast.DeferStmt)
    		if !ok {
    			return true // the following statement is not a defer.
    		}
    		root := rootIdent(def.Call.Fun)
    		if root == nil {
    			return true // could not find the receiver of the defer call.
    		}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 5K bytes
    - Viewed (0)
  7. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go

    	case *ast.CommentGroup:
    		// nop
    
    	case *ast.CompositeLit:
    		children = append(children,
    			tok(n.Lbrace, len("{")),
    			tok(n.Rbrace, len("{")))
    
    	case *ast.DeclStmt:
    		// nop
    
    	case *ast.DeferStmt:
    		children = append(children,
    			tok(n.Defer, len("defer")))
    
    	case *ast.Ellipsis:
    		children = append(children,
    			tok(n.Ellipsis, len("...")))
    
    	case *ast.EmptyStmt:
    		// nop
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 15.9K bytes
    - Viewed (0)
  8. src/go/ast/walk.go

    		Walk(v, n.Chan)
    		Walk(v, n.Value)
    
    	case *IncDecStmt:
    		Walk(v, n.X)
    
    	case *AssignStmt:
    		walkList(v, n.Lhs)
    		walkList(v, n.Rhs)
    
    	case *GoStmt:
    		Walk(v, n.Call)
    
    	case *DeferStmt:
    		Walk(v, n.Call)
    
    	case *ReturnStmt:
    		walkList(v, n.Results)
    
    	case *BranchStmt:
    		if n.Label != nil {
    			Walk(v, n.Label)
    		}
    
    	case *BlockStmt:
    		walkList(v, n.List)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:34:10 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/loopclosure/loopclosure.go

    		forEachLastStmt(body.List, func(last ast.Stmt) {
    			var stmts []ast.Stmt
    			switch s := last.(type) {
    			case *ast.GoStmt:
    				stmts = litStmts(s.Call.Fun)
    			case *ast.DeferStmt:
    				stmts = litStmts(s.Call.Fun)
    			case *ast.ExprStmt: // check for errgroup.Group.Go
    				if call, ok := s.X.(*ast.CallExpr); ok {
    					stmts = litStmts(goInvoke(pass.TypesInfo, call))
    				}
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 10.3K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/tools/go/cfg/builder.go

    	// It is effectively an additional default-nil parameter of stmt().
    	var label *lblock
    start:
    	switch s := _s.(type) {
    	case *ast.BadStmt,
    		*ast.SendStmt,
    		*ast.IncDecStmt,
    		*ast.GoStmt,
    		*ast.DeferStmt,
    		*ast.EmptyStmt,
    		*ast.AssignStmt:
    		// No effect on control flow.
    		b.add(s)
    
    	case *ast.ExprStmt:
    		b.add(s)
    		if call, ok := s.X.(*ast.CallExpr); ok && !b.mayReturn(call) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 11.4K bytes
    - Viewed (0)
Back to top