From 59bc3bb4027f11c5bfeccb8c2a927519d663cd44 Mon Sep 17 00:00:00 2001 From: steiler Date: Fri, 13 Feb 2026 12:01:50 +0100 Subject: [PATCH] remove the unused mutex from sharedEntryAttributes --- pkg/tree/root_entry_test.go | 8 -------- pkg/tree/sharedEntryAttributes.go | 2 -- pkg/tree/sharedEntryAttributes_test.go | 2 -- 3 files changed, 12 deletions(-) diff --git a/pkg/tree/root_entry_test.go b/pkg/tree/root_entry_test.go index 6303e2bd..661970b6 100644 --- a/pkg/tree/root_entry_test.go +++ b/pkg/tree/root_entry_test.go @@ -46,7 +46,6 @@ func TestRootEntry_TreeExport(t *testing.T) { parent: nil, pathElemName: "", childs: newChildMap(), - childsMutex: sync.RWMutex{}, schemaMutex: sync.RWMutex{}, cacheMutex: sync.Mutex{}, treeContext: tc, @@ -95,7 +94,6 @@ func TestRootEntry_TreeExport(t *testing.T) { parent: nil, pathElemName: "", childs: newChildMap(), - childsMutex: sync.RWMutex{}, schemaMutex: sync.RWMutex{}, cacheMutex: sync.Mutex{}, treeContext: tc, @@ -107,7 +105,6 @@ func TestRootEntry_TreeExport(t *testing.T) { parent: result, pathElemName: "interface", childs: newChildMap(), - childsMutex: sync.RWMutex{}, schemaMutex: sync.RWMutex{}, cacheMutex: sync.Mutex{}, } @@ -162,7 +159,6 @@ func TestRootEntry_TreeExport(t *testing.T) { parent: nil, pathElemName: "", childs: newChildMap(), - childsMutex: sync.RWMutex{}, schemaMutex: sync.RWMutex{}, cacheMutex: sync.Mutex{}, treeContext: tc, @@ -174,7 +170,6 @@ func TestRootEntry_TreeExport(t *testing.T) { parent: result, pathElemName: "interface", childs: newChildMap(), - childsMutex: sync.RWMutex{}, schemaMutex: sync.RWMutex{}, cacheMutex: sync.Mutex{}, } @@ -208,7 +203,6 @@ func TestRootEntry_TreeExport(t *testing.T) { parent: result, pathElemName: "system", childs: newChildMap(), - childsMutex: sync.RWMutex{}, schemaMutex: sync.RWMutex{}, cacheMutex: sync.Mutex{}, } @@ -263,7 +257,6 @@ func TestRootEntry_TreeExport(t *testing.T) { parent: nil, pathElemName: "", childs: newChildMap(), - childsMutex: sync.RWMutex{}, schemaMutex: sync.RWMutex{}, cacheMutex: sync.Mutex{}, treeContext: tc, @@ -275,7 +268,6 @@ func TestRootEntry_TreeExport(t *testing.T) { parent: result, pathElemName: "interface", childs: newChildMap(), - childsMutex: sync.RWMutex{}, schemaMutex: sync.RWMutex{}, cacheMutex: sync.Mutex{}, } diff --git a/pkg/tree/sharedEntryAttributes.go b/pkg/tree/sharedEntryAttributes.go index 6f8e68bb..fcbacfaa 100644 --- a/pkg/tree/sharedEntryAttributes.go +++ b/pkg/tree/sharedEntryAttributes.go @@ -34,7 +34,6 @@ type sharedEntryAttributes struct { pathElemName string // childs mutual exclusive with LeafVariants childs *childMap - childsMutex sync.RWMutex // leafVariants mutual exclusive with Childs // If Entry is a leaf it can hold multiple leafVariants leafVariants *LeafVariants @@ -63,7 +62,6 @@ func (s *sharedEntryAttributes) deepCopy(tc *TreeContext, parent Entry) (*shared schema: s.schema, treeContext: tc, choicesResolvers: s.choicesResolvers.deepCopy(), - childsMutex: sync.RWMutex{}, schemaMutex: sync.RWMutex{}, cacheMutex: sync.Mutex{}, level: s.level, diff --git a/pkg/tree/sharedEntryAttributes_test.go b/pkg/tree/sharedEntryAttributes_test.go index c569cd55..30428ed6 100644 --- a/pkg/tree/sharedEntryAttributes_test.go +++ b/pkg/tree/sharedEntryAttributes_test.go @@ -7,7 +7,6 @@ import ( "runtime" "slices" "strings" - "sync" "testing" "github.com/google/go-cmp/cmp" @@ -99,7 +98,6 @@ func Test_sharedEntryAttributes_DeepCopy(t *testing.T) { sharedEntryAttributes: &sharedEntryAttributes{ pathElemName: "__root__", childs: newChildMap(), - childsMutex: sync.RWMutex{}, choicesResolvers: choiceResolvers{}, parent: nil, treeContext: tc,