Skip to content

Commit 244db92

Browse files
committed
fix mock accessability to package level struct (sharedEntryAttributes)
chnaged sharedEntryAttributes to Entry parameter type in Walk function
1 parent b014a23 commit 244db92

File tree

4 files changed

+228
-59
lines changed

4 files changed

+228
-59
lines changed

mocks/mocktreeentry/entry.go

Lines changed: 220 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/tree/entry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ type Entry interface {
158158
}
159159

160160
type EntryVisitor interface {
161-
Visit(ctx context.Context, s *sharedEntryAttributes) error
161+
Visit(ctx context.Context, e Entry) error
162162
Up()
163163
}
164164

pkg/tree/visitor_blame_config.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,22 @@ func NewBlameConfigVisitor(includeDefaults bool) *BlameConfigVisitor {
2222
}
2323
}
2424

25-
func (b *BlameConfigVisitor) Visit(ctx context.Context, s *sharedEntryAttributes) error {
26-
name := s.pathElemName
27-
if s.IsRoot() {
25+
func (b *BlameConfigVisitor) Visit(ctx context.Context, e Entry) error {
26+
name := e.PathName()
27+
if e.IsRoot() {
2828
name = "root"
2929
}
3030
result := sdcpb.NewBlameTreeElement(name)
3131
skipAdd := false
3232

3333
// process Value
34-
highestLe := s.GetLeafVariantEntries().GetHighestPrecedence(false, true)
34+
highestLe := e.GetLeafVariantEntries().GetHighestPrecedence(false, true)
3535
if highestLe != nil {
3636
if highestLe.Update.Owner() != DefaultsIntentName || b.includeDefaults {
3737
result.SetValue(highestLe.Update.Value()).SetOwner(highestLe.Update.Owner())
3838

3939
// check if running equals the expected
40-
runningLe := s.GetLeafVariantEntries().GetRunning()
40+
runningLe := e.GetLeafVariantEntries().GetRunning()
4141
if runningLe != nil {
4242
if !proto.Equal(runningLe.Update.Value(), highestLe.Update.Value()) {
4343
result.DeviationValue = runningLe.Value()

pkg/tree/visitor_mark_owner_delete.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ func NewMarkOwnerDeleteVisitor(owner string, onlyIntended bool) *MarkOwnerDelete
1616
}
1717
}
1818

19-
func (o *MarkOwnerDeleteVisitor) Visit(ctx context.Context, s *sharedEntryAttributes) error {
20-
le := s.GetLeafVariantEntries().MarkOwnerForDeletion(o.owner, o.onlyIntended)
19+
func (o *MarkOwnerDeleteVisitor) Visit(ctx context.Context, e Entry) error {
20+
le := e.GetLeafVariantEntries().MarkOwnerForDeletion(o.owner, o.onlyIntended)
2121
if le != nil {
2222
o.leafVariantsMatched = append(o.leafVariantsMatched, le)
2323
}

0 commit comments

Comments
 (0)