MCPcopy Index your code
hub / github.com/rilldata/rill / buildStruct

Function buildStruct

cli/cmd/query/query.go:127–141  ·  view source on GitHub ↗
(m map[string]string)

Source from the content-addressed store, hash-verified

125}
126
127func buildStruct(m map[string]string) *structpb.Struct {
128 if m == nil {
129 return nil
130 }
131 anyMap := make(map[string]any, len(m))
132 for k, v := range m {
133 anyMap[k] = v
134 }
135 pb, err := structpb.NewStruct(anyMap)
136 if err != nil {
137 // Acceptable to panic because there are no unknown types, so this should never happen.
138 panic(fmt.Errorf("failed to build struct: %w", err))
139 }
140 return pb
141}

Callers 1

QueryCmdFunction · 0.85

Calls 1

ErrorfMethod · 0.65

Tested by

no test coverage detected