Address pull request comments
* Allocate with composite literal instead of new * Remove check of number of bytes read from rand
This commit is contained in:
@ -89,8 +89,9 @@ type keyStorePassphrase struct {
|
||||
}
|
||||
|
||||
func NewKeyStorePassphrase(path string) KeyStore2 {
|
||||
ks := new(keyStorePassphrase)
|
||||
ks.keysDirPath = path
|
||||
ks := &keyStorePassphrase{
|
||||
keysDirPath : path,
|
||||
}
|
||||
return ks
|
||||
}
|
||||
|
||||
@ -103,9 +104,10 @@ func (ks keyStorePassphrase) GetKey(keyId *uuid.UUID, auth string) (key *Key, er
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
key = new(Key)
|
||||
key.Id = keyId
|
||||
key.PrivateKey = ToECDSA(keyBytes)
|
||||
key = &Key{
|
||||
Id : keyId,
|
||||
PrivateKey : ToECDSA(keyBytes),
|
||||
}
|
||||
return key, err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user