Skip to content

Commit

Permalink
Address pull request comments
Browse files Browse the repository at this point in the history
* Further simplify "constructor" function's allocation of structs
* Fix formatting
  • Loading branch information
Gustav Simonsson committed Jan 19, 2015
1 parent 3cf038f commit d48140c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 3 additions & 6 deletions crypto/key_store_passphrase.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,7 @@ type keyStorePassphrase struct {
}

func NewKeyStorePassphrase(path string) KeyStore2 {
ks := &keyStorePassphrase{
keysDirPath : path,
}
return ks
return &keyStorePassphrase{path}
}

func (ks keyStorePassphrase) GenerateNewKey(rand io.Reader, auth string) (key *Key, err error) {
Expand All @@ -105,8 +102,8 @@ func (ks keyStorePassphrase) GetKey(keyId *uuid.UUID, auth string) (key *Key, er
return nil, err
}
key = &Key{
Id : keyId,
PrivateKey : ToECDSA(keyBytes),
Id: keyId,
PrivateKey: ToECDSA(keyBytes),
}
return key, err
}
Expand Down
4 changes: 1 addition & 3 deletions crypto/key_store_plain.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ func DefaultDataDir() string {
}

func NewKeyStorePlain(path string) KeyStore2 {
ks := new(keyStorePlain)
ks.keysDirPath = path
return ks
return &keyStorePlain{path}
}

func (ks keyStorePlain) GenerateNewKey(rand io.Reader, auth string) (key *Key, err error) {
Expand Down

0 comments on commit d48140c

Please sign in to comment.