tree.go ×7

Frontier kind: Code frontier

unlabeled · c_2d8830760c78

5 tests · 2965 LOC · 94 files · introduces 0 tests · 24 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges24 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
631 ranges2965 lines · 94 files · Browse complete extent
All tests (intent)
5 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: 24 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/chasm/tree.go 24 introduced LOC · 7 ranges

Open complete file

1044 }
1045
1046 > func (n *Node) stringToMapKey(nodeName string, key string, keyT reflect.Type) (reflect.Value, error) { tree.go
1047 > var (
1048 > keyV reflect.Value
1049 > err error
1050 > )
1051 > switch keyT.Kind() {
1052 > case reflect.String:
1053 > keyV = reflect.ValueOf(key)
1054 case reflect.Int:
1055 var x int64
1106 }
1107
1108 > if err == nil && !keyV.IsValid() { tree.go
1109 err = fmt.Errorf("value %s is not valid of type %s of kind %s", key, keyT.String(), keyT.Kind().String())
1110 }
1111
1112 > if err != nil { tree.go
1113 err = softassert.UnexpectedInternalErr(
1114 n.logger,
1117 }
1118
1119 > return keyV, err tree.go
1120 }
1121
1348 case fieldKindSubMap:
1349 if collectionNode, found := n.children[field.name]; found {
1350 > mapFieldV := field.val tree.go
1351 > if mapFieldV.IsNil() {
1352 > mapFieldV = reflect.MakeMapWithSize(field.typ, field.val.Len())
1353 > field.val.Set(mapFieldV)
1354 > }
1355
1356 > for collectionItemName, collectionItemNode := range collectionNode.children { tree.go
1357 > // field.typ.Elem() is a go type of map item: Field[T]
1358 > chasmFieldV := reflect.New(field.typ.Elem()).Elem()
1359 > internalValue := reflect.ValueOf(newFieldInternalWithNode(collectionItemNode))
1360 > chasmFieldV.FieldByName(internalFieldName).Set(internalValue)
1361 > mapKeyV, err := n.stringToMapKey(field.name, collectionItemName, mapFieldV.Type().Key())
1362 > if err != nil {
1363 return err
1364 }
1365 > mapFieldV.SetMapIndex(mapKeyV, chasmFieldV) tree.go
1366 }
1367 } else if field.val.IsNil() {