Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for KeyValueExpr (0.12 sec)

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

    	}
    }
    
    // checkCopyLocksCompositeLit detects lock copy inside a composite literal
    func checkCopyLocksCompositeLit(pass *analysis.Pass, cl *ast.CompositeLit) {
    	for _, x := range cl.Elts {
    		if node, ok := x.(*ast.KeyValueExpr); ok {
    			x = node.Value
    		}
    		if path := lockPathRhs(pass, x); path != nil {
    			pass.ReportRangef(x, "literal copies lock value from %v: %v", analysisutil.Format(pass.Fset, x), path)
    		}
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 9.9K bytes
    - Viewed (0)
  2. src/go/ast/filter.go

    func filterExprList(list []Expr, filter Filter, export bool) []Expr {
    	j := 0
    	for _, exp := range list {
    		switch x := exp.(type) {
    		case *CompositeLit:
    			filterCompositeLit(x, filter, export)
    		case *KeyValueExpr:
    			if x, ok := x.Key.(*Ident); ok && !filter(x.Name) {
    				continue
    			}
    			if x, ok := x.Value.(*CompositeLit); ok {
    				filterCompositeLit(x, filter, export)
    			}
    		}
    		list[j] = exp
    		j++
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  3. src/go/doc/example.go

    			// (For an expression like fmt.Println, only add "fmt" to the
    			// set of unresolved names, not "Println".)
    			ast.Inspect(e.X, inspectFunc)
    			return false
    		case *ast.KeyValueExpr:
    			// For key value expressions, only inspect the value
    			// as the key should be resolved by the type of the
    			// composite literal.
    			ast.Inspect(e.Value, inspectFunc)
    			return false
    		}
    		return true
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 21.4K bytes
    - Viewed (0)
Back to top