[#190] crypto: Doc RegisterScheme isn't thread-unsafe

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
remotes/fyrchik/split-info-format
Leonard Lyubich 2022-04-19 11:18:29 +03:00 committed by LeL
parent 9f20d74d76
commit 6554c681c8
1 changed files with 2 additions and 0 deletions

View File

@ -32,6 +32,8 @@ var publicKeys = make(map[Scheme]func() PublicKey)
// function in packages that implement signature schemes.
//
// RegisterScheme panics if function for the given Scheme is already registered.
//
// Note that RegisterScheme isn't tread-safe.
func RegisterScheme(scheme Scheme, f func() PublicKey) {
_, ok := publicKeys[scheme]
if ok {