parallelize.go ×8

Frontier kind: Code frontier

unlabeled · c_1a34ec370593

2 tests · 76 LOC · 1 file · introduces 0 tests · 21 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges21 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
31 ranges76 lines · 1 file · Browse complete extent
All tests (intent)
2 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 21 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/tools/parallelize/parallelize.go 21 introduced LOC · 8 ranges

Open complete file

76 continue
77 }
78 > bodyLine := fset.Position(fn.Body.Lbrace).Line parallelize.go
79 > insertions = append(insertions, insertion{line: bodyLine, paramName: paramName})
80 }
81
85
86 // Sort by line descending so insertions don't shift line numbers of subsequent insertions.
87 > sort.Slice(insertions, func(i, j int) bool { parallelize.go
88 return insertions[i].line > insertions[j].line
89 })
90
91 > fi, err := os.Stat(path) parallelize.go
92 > if err != nil {
93 return fmt.Errorf("stat %s: %w", path, err)
94 }
95
96 > src, err := os.ReadFile(path) parallelize.go
97 > if err != nil {
98 return fmt.Errorf("read %s: %w", path, err)
99 }
100
101 > lines := strings.Split(string(src), "\n") parallelize.go
102 > for _, ins := range insertions {
103 > // ins.line is 1-indexed, so it conveniently equals the 0-based index
104 > // of the line right after '{', which is where we want to insert.
105 > idx := ins.line
106 > newLine := "\t" + ins.paramName + ".Parallel()"
107 > lines = append(lines[:idx+1], lines[idx:]...)
108 > lines[idx] = newLine
109 > }
110
111 > if err := os.WriteFile(path, []byte(strings.Join(lines, "\n")), fi.Mode()); err != nil { parallelize.go
112 return fmt.Errorf("write %s: %w", path, err)
113 }
114
115 > fmt.Printf("parallelize: %s\n", path) parallelize.go
116 > return nil
117 }
118
161 func hasNoLintComment(fn *ast.FuncDecl) bool {
162 if fn.Doc == nil {
163 > return false parallelize.go
164 > }
165 for _, c := range fn.Doc.List {
166 if strings.Contains(c.Text, "parallelize:ignore") {