Atlas › Test

TestFieldMaskHasPathOrSubPath

Exact test identity: go.temporal.io/server/common/util/TestFieldMaskHasPathOrSubPath

Package
go.temporal.io/server/common/util
Suite / test hierarchy
TestFieldMaskHasPathOrSubPath
Test
TestFieldMaskHasPathOrSubPath
Introduced at
TestFieldMaskHasPathOrSubPath Frontier kind: Test frontier
Covered ranges
6
Covered lines
12
Covered files
1

Covered source

Expand a file to inspect source; the > gutter marks covered lines.

go.temporal.io/server/common/util/proto.go 12 covered LOC · 6 ranges

Open complete file

48 }
49
50 > func FieldMaskHasSubPath(fieldMaskPaths map[string]struct{}, path string) bool { proto.go
51 > prefix := strings.TrimSuffix(path, ".") + "."
52 > for field := range fieldMaskPaths {
53 > if strings.HasPrefix(field, prefix) {
54 > return true proto.go
55 > }
56 }
57 > return false proto.go
58 }
59
60 > func FieldMaskHasPathOrSubPath(fieldMaskPaths map[string]struct{}, path string) bool { proto.go
61 > if _, ok := fieldMaskPaths[path]; ok {
62 > return true proto.go
63 > }
64 > return FieldMaskHasSubPath(fieldMaskPaths, path) proto.go
65 }