Use RWMutex instead of Mutex

This commit is contained in:
Adnan Maolood 2020-12-17 17:08:45 -05:00
parent 4704b8fbcf
commit 7be0715d39
2 changed files with 2 additions and 2 deletions

View File

@ -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.

View File

@ -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.