Use RWMutex instead of Mutex
This commit is contained in:
parent
4704b8fbcf
commit
7be0715d39
2
cert.go
2
cert.go
|
@ -30,7 +30,7 @@ type CertificateDir struct {
|
||||||
CertificateStore
|
CertificateStore
|
||||||
dir bool
|
dir bool
|
||||||
path string
|
path string
|
||||||
mu sync.Mutex
|
mu sync.RWMutex
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add adds a certificate for the given scope to the store.
|
// Add adds a certificate for the given scope to the store.
|
||||||
|
|
2
tofu.go
2
tofu.go
|
@ -31,7 +31,7 @@ type KnownHosts map[string]Fingerprint
|
||||||
type KnownHostsFile struct {
|
type KnownHostsFile struct {
|
||||||
KnownHosts
|
KnownHosts
|
||||||
out io.Writer
|
out io.Writer
|
||||||
mu sync.Mutex
|
mu sync.RWMutex
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetOutput sets the output to which new known hosts will be written to.
|
// SetOutput sets the output to which new known hosts will be written to.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user