From 7be0715d39a7dcef223eebd13d4c21ef204cb25f Mon Sep 17 00:00:00 2001 From: Adnan Maolood Date: Thu, 17 Dec 2020 17:08:45 -0500 Subject: [PATCH] Use RWMutex instead of Mutex --- cert.go | 2 +- tofu.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cert.go b/cert.go index c2c0c5e..dd8a1f5 100644 --- a/cert.go +++ b/cert.go @@ -30,7 +30,7 @@ type CertificateDir struct { CertificateStore dir bool path string - mu sync.Mutex + mu sync.RWMutex } // Add adds a certificate for the given scope to the store. diff --git a/tofu.go b/tofu.go index 44b4648..9fa08eb 100644 --- a/tofu.go +++ b/tofu.go @@ -31,7 +31,7 @@ type KnownHosts map[string]Fingerprint type KnownHostsFile struct { KnownHosts out io.Writer - mu sync.Mutex + mu sync.RWMutex } // SetOutput sets the output to which new known hosts will be written to.