From a3d157bde6970567605d499d2780b603c76b1239 Mon Sep 17 00:00:00 2001 From: James Shubin Date: Tue, 20 Dec 2016 05:15:57 -0500 Subject: [PATCH] pgraph: Mutex must be a pointer This should be done the same way as the WaitGroup so that we don't panic! --- pgraph/pgraph.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pgraph/pgraph.go b/pgraph/pgraph.go index 3a464f4a..d698f139 100644 --- a/pgraph/pgraph.go +++ b/pgraph/pgraph.go @@ -79,8 +79,9 @@ func NewGraph(name string) *Graph { Name: name, Adjacency: make(map[*Vertex]map[*Vertex]*Edge), state: graphStateNil, - // ptr b/c: "A WaitGroup must not be copied after first use." - wg: &sync.WaitGroup{}, + // ptr b/c: Mutex/WaitGroup must not be copied after first use + mutex: &sync.Mutex{}, + wg: &sync.WaitGroup{}, } }