From 66abd54ad630168d53f530d6e68598656e6bdc26 Mon Sep 17 00:00:00 2001 From: Takafumi Miyanaga Date: Fri, 16 Aug 2024 02:22:54 +0900 Subject: [PATCH] refactor: keygen: refactor same expression (#16) This commit refactors same expression in keygen.go. Signed-off-by: orangekame3 --- keygen.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/keygen.go b/keygen.go index 2535ea5..7c6bb91 100644 --- a/keygen.go +++ b/keygen.go @@ -473,11 +473,8 @@ func (s *KeyPair) WriteKeys() error { if memo := pubKeyMemo(); memo != "" { ak = fmt.Sprintf("%s %s", ak, memo) } - if err := writeKeyToFile([]byte(ak), s.publicKeyPath()); err != nil { - return err - } - return nil + return writeKeyToFile([]byte(ak), s.publicKeyPath()) } // KeyPairExists checks if the SSH key pair exists on disk.