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

Function Sections

codegen/codegentest/codegentest.go:13–27  ·  view source on GitHub ↗

Sections can be used to extract the code sections that match a path suffix and a section name.

(files []*codegen.File, pathSuffix string, sectionName string)

Source from the content-addressed store, hash-verified

11// Sections can be used to extract the code sections that match a path suffix
12// and a section name.
13func Sections(files []*codegen.File, pathSuffix string, sectionName string) []*codegen.SectionTemplate {
14 var result []*codegen.SectionTemplate
15 for _, file := range files {
16 if !strings.HasSuffix(file.Path, pathSuffix) {
17 continue
18 }
19
20 for _, section := range file.SectionTemplates {
21 if section.Name == sectionName {
22 result = append(result, section)
23 }
24 }
25 }
26 return result
27}

Callers 3

TestServerMountFunction · 0.92
TestServerHandlerFunction · 0.92
TestHandlerInitFunction · 0.92

Calls

no outgoing calls

Tested by 3

TestServerMountFunction · 0.74
TestServerHandlerFunction · 0.74
TestHandlerInitFunction · 0.74