diff options
author | Gustav Simonsson <gustav.simonsson@gmail.com> | 2015-01-20 03:24:30 +0800 |
---|---|---|
committer | Gustav Simonsson <gustav.simonsson@gmail.com> | 2015-01-20 03:24:30 +0800 |
commit | 3cf038f300950c5a14b99fb0249ec09f663ef6af (patch) | |
tree | 1f47a770b06507e679775dce7c6361d8c8aa6055 /crypto/key_store_passphrase.go | |
parent | 9caf32befebb41fbb013b299caf2fff5fe840430 (diff) | |
download | go-tangerine-3cf038f300950c5a14b99fb0249ec09f663ef6af.tar go-tangerine-3cf038f300950c5a14b99fb0249ec09f663ef6af.tar.gz go-tangerine-3cf038f300950c5a14b99fb0249ec09f663ef6af.tar.bz2 go-tangerine-3cf038f300950c5a14b99fb0249ec09f663ef6af.tar.lz go-tangerine-3cf038f300950c5a14b99fb0249ec09f663ef6af.tar.xz go-tangerine-3cf038f300950c5a14b99fb0249ec09f663ef6af.tar.zst go-tangerine-3cf038f300950c5a14b99fb0249ec09f663ef6af.zip |
Address pull request comments
* Allocate with composite literal instead of new
* Remove check of number of bytes read from rand
Diffstat (limited to 'crypto/key_store_passphrase.go')
-rw-r--r-- | crypto/key_store_passphrase.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/crypto/key_store_passphrase.go b/crypto/key_store_passphrase.go index c7f740ae3..68135a4f0 100644 --- a/crypto/key_store_passphrase.go +++ b/crypto/key_store_passphrase.go @@ -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 } |