MCPcopy Create free account
hub / github.com/goadesign/goa / AppendHelpers

Function AppendHelpers

codegen/transformer.go:157–171  ·  view source on GitHub ↗

AppendHelpers takes care of only appending helper functions from newH that are not already in oldH.

(oldH, newH []*TransformFunctionData)

Source from the content-addressed store, hash-verified

155// AppendHelpers takes care of only appending helper functions from newH that
156// are not already in oldH.
157func AppendHelpers(oldH, newH []*TransformFunctionData) []*TransformFunctionData {
158 for _, h := range newH {
159 found := false
160 for _, h2 := range oldH {
161 if h.Name == h2.Name {
162 found = true
163 break
164 }
165 }
166 if !found {
167 oldH = append(oldH, h)
168 }
169 }
170 return oldH
171}
172
173// MapDepth returns the level of nested maps. For unnested maps, it returns 0.
174func MapDepth(m *expr.Map) int {

Callers 11

buildPayloadDataMethod · 0.92
buildResponsesMethod · 0.92
buildErrorsDataMethod · 0.92
buildRequestBodyTypeMethod · 0.92
buildResponseBodyTypeMethod · 0.92
initWebSocketDataMethod · 0.92
buildInitDataMethod · 0.92
ConvertFileFunction · 0.92
FilesFunction · 0.92
InitStructFieldsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected