forked from TrueCloudLab/frostfs-sdk-go
[#190] crypto: Doc RegisterScheme isn't thread-unsafe
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
9f20d74d76
commit
6554c681c8
1 changed files with 2 additions and 0 deletions
|
@ -32,6 +32,8 @@ var publicKeys = make(map[Scheme]func() PublicKey)
|
||||||
// function in packages that implement signature schemes.
|
// function in packages that implement signature schemes.
|
||||||
//
|
//
|
||||||
// RegisterScheme panics if function for the given Scheme is already registered.
|
// 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) {
|
func RegisterScheme(scheme Scheme, f func() PublicKey) {
|
||||||
_, ok := publicKeys[scheme]
|
_, ok := publicKeys[scheme]
|
||||||
if ok {
|
if ok {
|
||||||
|
|
Loading…
Reference in a new issue