- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 169 for elts (0.04 sec)
-
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/composite/composite.go
continue } // check if the struct contains an unkeyed field allKeyValue := true var suggestedFixAvailable = len(cl.Elts) == strct.NumFields() var missingKeys []analysis.TextEdit for i, e := range cl.Elts { if _, ok := e.(*ast.KeyValueExpr); !ok { allKeyValue = false if i >= strct.NumFields() { break } field := strct.Field(i)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 02:20:05 UTC 2024 - 4.4K bytes - Viewed (0) -
src/cmd/compile/internal/types2/index.go
} // indexedElts checks the elements (elts) of an array or slice composite literal // against the literal's element type (typ), and the element indices against // the literal length if known (length >= 0). It returns the length of the // literal (maximum index value + 1). func (check *Checker) indexedElts(elts []syntax.Expr, typ Type, length int64) int64 { visited := make(map[int64]bool, len(elts)) var index, max int64
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Sep 15 16:16:58 UTC 2023 - 11.5K bytes - Viewed (0) -
src/go/types/index.go
} // indexedElts checks the elements (elts) of an array or slice composite literal // against the literal's element type (typ), and the element indices against // the literal length if known (length >= 0). It returns the length of the // literal (maximum index value + 1). func (check *Checker) indexedElts(elts []ast.Expr, typ Type, length int64) int64 { visited := make(map[int64]bool, len(elts)) var index, max int64
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Jan 22 16:17:05 UTC 2024 - 11.2K bytes - Viewed (0) -
src/go/ast/filter.go
removedFields = true } fields.List = list[0:j] return } func filterCompositeLit(lit *CompositeLit, filter Filter, export bool) { n := len(lit.Elts) lit.Elts = filterExprList(lit.Elts, filter, export) if len(lit.Elts) < n { lit.Incomplete = true } } func filterExprList(list []Expr, filter Filter, export bool) []Expr { j := 0 for _, exp := range list {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 13.3K bytes - Viewed (0) -
src/go/types/expr.go
goto Error } if len(e.Elts) == 0 { break } // Convention for error messages on invalid struct literals: // we mention the struct type only if it clarifies the error // (e.g., a duplicate field error doesn't need the struct type). fields := utyp.fields if _, ok := e.Elts[0].(*ast.KeyValueExpr); ok { // all elements must have keys
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 29 02:09:54 UTC 2024 - 49.7K bytes - Viewed (0) -
src/go/types/exprstring.go
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("…") } buf.WriteByte('}')
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/compile/internal/typecheck/typecheck.go
var kv *ir.KeyExpr if elt.Op() == ir.OKEY { elt := elt.(*ir.KeyExpr) elt.Key = Expr(elt.Key) key = IndexConst(elt.Key) if key < 0 { base.Fatalf("invalid index: %v", elt.Key) } kv = elt r = elt.Value } r = Expr(r) r = AssignConv(r, elemType, ctx) if kv != nil { kv.Value = r } else { elts[i] = r } if key >= 0 {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Mar 20 19:08:34 UTC 2024 - 30.5K bytes - Viewed (0) -
src/go/ast/walk.go
// 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: Walk(v, n.X) Walk(v, n.Sel)
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/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 {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jun 04 16:19:04 UTC 2024 - 9.9K bytes - Viewed (0) -
src/go/printer/testdata/parser.go
if p.trace { defer un(trace(p, "LiteralValue")) } lbrace := p.expect(token.LBRACE) var elts []ast.Expr p.exprLev++ if p.tok != token.RBRACE { elts = p.parseElementList() } p.exprLev-- rbrace := p.expect(token.RBRACE) return &ast.CompositeLit{typ, lbrace, elts, rbrace} } // checkExpr checks that x is an expression (and not a type).
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Jul 20 20:19:51 UTC 2023 - 50.5K bytes - Viewed (0)