MCPcopy Index your code
hub / github.com/github/github-mcp-server / hasUnkeyedFields

Function hasUnkeyedFields

pkg/toolvalidation/readonlyhint.go:193–200  ·  view source on GitHub ↗

hasUnkeyedFields reports whether the composite literal has any positional (non-key/value) elements. The static check cannot reliably map positional fields without full type information, so such literals are rejected with a dedicated diagnostic rather than producing false "missing field" violations.

(cl *ast.CompositeLit)

Source from the content-addressed store, hash-verified

191// fields without full type information, so such literals are rejected with a
192// dedicated diagnostic rather than producing false "missing field" violations.
193func hasUnkeyedFields(cl *ast.CompositeLit) bool {
194 for _, elt := range cl.Elts {
195 if _, ok := elt.(*ast.KeyValueExpr); !ok {
196 return true
197 }
198 }
199 return false
200}
201
202// findFieldValue returns the value expression for the named keyed field of a
203// composite literal, or nil if the field is absent.

Callers 1

checkToolLiteralFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected