From dfff6c90b81c36a403033be03994e0d61f79f8be Mon Sep 17 00:00:00 2001 From: Johan Lindh Date: Thu, 25 Jan 2024 09:30:18 +0100 Subject: [PATCH] use simple mutex --- string.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/string.go b/string.go index f67d575..ac409cf 100644 --- a/string.go +++ b/string.go @@ -9,7 +9,7 @@ import ( // String wraps a mutex and a string, and implements jaws.StringSetter and jaws.HtmlGetter. // String.JawsGetHtml() will escape the string before returning it. type String struct { - mu sync.RWMutex + mu sync.Mutex Value string } @@ -20,9 +20,9 @@ func (s *String) Set(val string) { } func (s *String) Get() (val string) { - s.mu.RLock() + s.mu.Lock() val = s.Value - s.mu.RUnlock() + s.mu.Unlock() return }