Make used of typed atomic.Pointer (#23550)

Этот коммит содержится в:
Ben Schumacher
2023-05-31 12:56:01 +02:00
коммит произвёл GitHub
родитель 2ac375b3fe
Коммит 7a9a098ce4
6 изменённых файлов: 14 добавлений и 17 удалений

Просмотреть файл

@@ -198,10 +198,7 @@ func (ps *PlatformService) regenerateClientConfig() {
// AsymmetricSigningKey will return a private key that can be used for asymmetric signing.
func (ps *PlatformService) AsymmetricSigningKey() *ecdsa.PrivateKey {
if key := ps.asymmetricSigningKey.Load(); key != nil {
return key.(*ecdsa.PrivateKey)
}
return nil
return ps.asymmetricSigningKey.Load()
}
// EnsureAsymmetricSigningKey ensures that an asymmetric signing key exists and future calls to