Skip to content

Commit 13ddee9

Browse files
committed
Lint
1 parent 6ebc06a commit 13ddee9

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

keystore/cli/cli.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ import (
1212
"time"
1313

1414
"github.com/jmoiron/sqlx"
15-
_ "github.com/lib/pq"
15+
_ "github.com/lib/pq" // Register postgres driver
1616
"github.com/spf13/cobra"
1717

18-
"github.com/smartcontractkit/chainlink-common/keystore"
1918
ks "github.com/smartcontractkit/chainlink-common/keystore"
2019
"github.com/smartcontractkit/chainlink-common/keystore/kms"
2120
"github.com/smartcontractkit/chainlink-common/keystore/pgstore"
@@ -129,7 +128,7 @@ func NewCreateCmd() *cobra.Command {
129128
cmd := cobra.Command{
130129
Use: "create", Short: "Create a key",
131130
RunE: func(cmd *cobra.Command, args []string) error {
132-
return runKeystoreCommand[ks.Keystore, ks.CreateKeysRequest, ks.CreateKeysResponse](cmd, args, loadKeystore, func(ctx context.Context, k keystore.Keystore, req ks.CreateKeysRequest) (ks.CreateKeysResponse, error) {
131+
return runKeystoreCommand[ks.Keystore, ks.CreateKeysRequest, ks.CreateKeysResponse](cmd, args, loadKeystore, func(ctx context.Context, k ks.Keystore, req ks.CreateKeysRequest) (ks.CreateKeysResponse, error) {
133132
return k.CreateKeys(ctx, req)
134133
})
135134
},
@@ -158,7 +157,7 @@ func NewDeleteCmd() *cobra.Command {
158157
}
159158
if !confirmYes {
160159
// Prompt for confirmation on stdin
161-
_, err = cmd.OutOrStderr().Write([]byte(fmt.Sprintf("This will permanently delete keys: %v. Type 'yes' to confirm: ", strings.Join(req.KeyNames, ", "))))
160+
_, err = fmt.Fprintf(cmd.OutOrStderr(), "This will permanently delete keys: %v. Type 'yes' to confirm: ", strings.Join(req.KeyNames, ", "))
162161
if err != nil {
163162
return err
164163
}

keystore/cli/cli_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ func setupKeystore(t *testing.T) func(t *testing.T) {
2222
require.NoError(t, err)
2323
t.Setenv("KEYSTORE_FILE_PATH", keystoreFile)
2424
t.Setenv("KEYSTORE_PASSWORD", "testpassword")
25+
// Set to empty string to test regular keystore mode.
26+
t.Setenv("KEYSTORE_KMS_PROFILE", "")
2527
return func(t *testing.T) {
2628
f.Close()
2729
os.RemoveAll(tempDir)

0 commit comments

Comments
 (0)