Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 106 for callExpr (0.32 sec)

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

    }
    
    func run(pass *analysis.Pass) (interface{}, error) {
    	if !analysisutil.Imports(pass.Pkg, "time") {
    		return nil, nil
    	}
    
    	checkDeferCall := func(node ast.Node) bool {
    		switch v := node.(type) {
    		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
    		}
    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/cmd/gofmt/rewrite.go

    		// match since that is how f(x) and f(x...) are different.
    		// Check them here but fall through for the remaining fields.
    		p := pattern.Interface().(*ast.CallExpr)
    		v := val.Interface().(*ast.CallExpr)
    		if p.Ellipsis.IsValid() != v.Ellipsis.IsValid() {
    			return false
    		}
    	}
    
    	p := reflect.Indirect(pattern)
    	v := reflect.Indirect(val)
    	if !p.IsValid() || !v.IsValid() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 27 22:07:13 UTC 2023
    - 8.1K bytes
    - Viewed (0)
  3. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/lostcancel/lostcancel.go

    	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) {
    		case *ast.FuncLit:
    			if len(stack) > 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 22 19:00:13 UTC 2024
    - 9K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/walk/stmt.go

    // a go or defer statement; that is, whether it's a regular function
    // call without arguments or results.
    func validGoDeferCall(call ir.Node) bool {
    	if call, ok := call.(*ir.CallExpr); ok && call.Op() == ir.OCALLFUNC && len(call.KeepAlive) == 0 {
    		sig := call.Fun.Type()
    		return sig.NumParams()+sig.NumResults() == 0
    	}
    	return false
    }
    
    // walkGoDefer walks an OGO or ODEFER node.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 06 15:42:30 UTC 2023
    - 4.7K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/types2/errorcalls_test.go

    func TestErrorCalls(t *testing.T) {
    	files, err := pkgFiles(".")
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	for _, file := range files {
    		syntax.Inspect(file, func(n syntax.Node) bool {
    			call, _ := n.(*syntax.CallExpr)
    			if call == nil {
    				return true
    			}
    			selx, _ := call.Fun.(*syntax.SelectorExpr)
    			if selx == nil {
    				return true
    			}
    			if !(isName(selx.X, "check") && isName(selx.Sel, "errorf")) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 15 21:57:36 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/syntax/positions.go

    			m = n.X
    		case *TypeSwitchGuard:
    			if n.Lhs != nil {
    				m = n.Lhs
    				continue
    			}
    			m = n.X
    		case *Operation:
    			if n.Y != nil {
    				m = n.X
    				continue
    			}
    			return n.Pos()
    		case *CallExpr:
    			m = n.Fun
    		case *ListExpr:
    			if len(n.ElemList) > 0 {
    				m = n.ElemList[0]
    				continue
    			}
    			return n.Pos()
    		// types
    		// case *ArrayType:
    		// case *SliceType:
    		// case *DotsType:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 17:49:19 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/walk/expr.go

    	case ir.OPRINT, ir.OPRINTLN:
    		return walkPrint(n.(*ir.CallExpr), init)
    
    	case ir.OPANIC:
    		n := n.(*ir.UnaryExpr)
    		return mkcall("gopanic", nil, init, n.X)
    
    	case ir.ORECOVERFP:
    		return walkRecoverFP(n.(*ir.CallExpr), init)
    
    	case ir.OCFUNC:
    		return n
    
    	case ir.OCALLINTER, ir.OCALLFUNC:
    		n := n.(*ir.CallExpr)
    		return walkCall(n, init)
    
    	case ir.OAS, ir.OASOP:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:01 UTC 2024
    - 27.6K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/reflectdata/helpers.go

    }
    
    // AppendElemRType asserts that n is an "append" operation, and
    // returns an expression that yields the *runtime._type value
    // representing the result slice type's element type.
    func AppendElemRType(pos src.XPos, n *ir.CallExpr) ir.Node {
    	assertOp(n, ir.OAPPEND)
    	if hasRType(n, n.RType, "RType") {
    		return n.RType
    	}
    	return sliceElemRType(pos, n.Type())
    }
    
    // CompareRType asserts that n is a comparison (== or !=) operation
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 12 04:50:32 UTC 2023
    - 7.1K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/walk/order.go

    		case *ir.BinaryExpr:
    			n.X = o.expr(n.X, nil)
    			n.Y = o.expr(n.Y, nil)
    		case *ir.MakeExpr:
    			n.Len = o.expr(n.Len, nil)
    			n.Cap = o.expr(n.Cap, nil)
    		case *ir.CallExpr:
    			o.exprList(n.Args)
    		}
    		return
    	}
    
    	n := nn.(*ir.CallExpr)
    	typecheck.AssertFixedCall(n)
    
    	if ir.IsFuncPCIntrinsic(n) && ir.IsIfaceOfFunc(n.Args[0]) != nil {
    		// For internal/abi.FuncPCABIxxx(fn), if fn is a defined function,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 02:00:33 UTC 2024
    - 42.7K bytes
    - Viewed (0)
  10. src/go/ast/ast.go

    		Lparen token.Pos // position of "("
    		Type   Expr      // asserted type; nil means type switch X.(type)
    		Rparen token.Pos // position of ")"
    	}
    
    	// A CallExpr node represents an expression followed by an argument list.
    	CallExpr struct {
    		Fun      Expr      // function expression
    		Lparen   token.Pos // position of "("
    		Args     []Expr    // function arguments; or nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 28 21:32:41 UTC 2024
    - 35.6K bytes
    - Viewed (0)
Back to top