pattern.go ×7

Frontier kind: Code frontier

unlabeled · c_f47f986f73a7

4 tests · 310 LOC · 5 files · introduces 0 tests · 23 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges23 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
70 ranges310 lines · 5 files · Browse complete extent
All tests (intent)
4 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.

Introduced files, introduced tests, and structurally relevant concept specializationreport.go ×3 · 6 introduced LOCreport.go ×3report.go ×3 · 6 introduced LOCreport.go ×3allows_expected_retained_objects · 0 introduced LOCallows_expected_retained…pattern.go ×1 · 2 introduced LOCpattern.go ×1pattern.go ×1 · 5 introduced LOCpattern.go ×1pattern.go ×1 · 2 introduced LOCpattern.go ×1leakcheck.go ×1 · 4 introduced LOCleakcheck.go ×1leakcheck.go ×1 · 1 introduced LOCleakcheck.go ×1report.go ×24 · 287 introduced LOCreport.go ×24TestOperatorServiceMetadata, TestWorkflowServiceMetadata · 0 introduced LOCTestOperatorServiceMetad…go.temporal.io/server/common/testing/objectleak/leakcheck.go · 132 LOCobjectleak/leakcheck.gogo.temporal.io/server/common/testing/objectleak/path.go · 75 LOCobjectleak/path.gogo.temporal.io/server/common/testing/objectleak/pattern.go · 74 LOCobjectleak/pattern.gogo.temporal.io/server/common/testing/objectleak/report.go · 224 LOCobjectleak/report.gogo.temporal.io/server/common/testing/objectleak/walker.go · 116 LOCobjectleak/walker.goTestOperatorServiceMetadata · introduced test · go.temporal.io/server/common/api/TestOperatorServiceMetadataTestOperatorServiceMetad…TestWorkflowServiceMetadata · introduced test · go.temporal.io/server/common/api/TestWorkflowServiceMetadataTestWorkflowServiceMetad…allows_expected_retained_objects · introduced test · go.temporal.io/server/common/testing/objectleak/TestObjectLeak_Check/allows_expected_retained_objectsallows_expected_retained…fails_stale_expected_pattern · introduced test · go.temporal.io/server/common/testing/objectleak/TestObjectLeak_Check/fails_stale_expected_patternfails_stale_expected_pat…fails_stale_prune · introduced test · go.temporal.io/server/common/testing/objectleak/TestObjectLeak_Check/fails_stale_prunefails_stale_pruneprunes_matched_type · introduced test · go.temporal.io/server/common/testing/objectleak/TestObjectLeak_Check/prunes_matched_typeprunes_matched_typeFocused concept · pattern.go ×7 · 23 introduced LOCpattern.go ×7

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.

3 files ranked by introduced lines: 23 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/testing/objectleak/pattern.go 17 introduced LOC · 7 ranges

Open complete file

14 type patterns []pattern
15
16 > func newPattern(value string) pattern { pattern.go
17 > return pattern{value: value}
18 > }
19
20 > func (p pattern) String() string { pattern.go
21 > return p.value
22 > }
23
24 > func (p pattern) matches(value string) bool { pattern.go
25 > if prefix, ok := strings.CutSuffix(p.value, "*"); ok {
26 return strings.HasPrefix(value, prefix)
27 }
28 > return value == p.value pattern.go
29 }
30
31 > func (p pattern) matchesObject(obj trackedObject) bool { pattern.go
32 > return p.matches(obj.path.normalized()) || p.matches(obj.typeName)
33 > }
34
35 func (ps patterns) matchObject(obj trackedObject) []string {
36 var matches []string
37 for i := range ps {
38 > if ps[i].matchesObject(obj) { pattern.go
39 > ps[i].matched = true
40 > matches = append(matches, ps[i].String())
41 > }
42 }
43 return matches
67 var unmatched []string
68 for _, pattern := range ps {
69 > if !pattern.matched { pattern.go
70 unmatched = append(unmatched, pattern.String())
71 }
go.temporal.io/server/common/testing/objectleak/leakcheck.go 3 introduced LOC · 1 range

Open complete file

32 func WithExpected(pattern string) Option {
33 return func(t *ObjectLeakCheck) error {
34 > t.expected = append(t.expected, newPattern(pattern)) leakcheck.go
35 > return nil
36 > }
37 }
38
go.temporal.io/server/common/testing/objectleak/report.go 3 introduced LOC · 2 ranges

Open complete file

60 expected := len(expectedBy) > 0
61 if expected {
62 > report.expectedRetainedPaths++ report.go
63 > expectedAddresses[obj.addr] = struct{}{}
64 } else {
65 report.unexpectedRetainedPaths++
96 for key, group := range groupByKey {
97 if key.expected {
98 > report.expectedObjects = append(report.expectedObjects, *group) report.go
99 } else {
100 report.unexpectedObjects = append(report.unexpectedObjects, *group)