From 8a1a81a6428ae970569d9c2a506acf90deb2e0c4 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Mon, 24 Jul 2023 13:01:36 +0700 Subject: all: unfold private key path before reading By unfolding, user can set the path to private key using "~" that points to their home. This make the key can works across home directory, in case user have multiple homes (Linux and macOS have different home path and maybe user name, but both can use "~" as substitution for $HOME) --- cli_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'cli_test.go') diff --git a/cli_test.go b/cli_test.go index 81253b1..5eeffd4 100644 --- a/cli_test.go +++ b/cli_test.go @@ -151,14 +151,15 @@ func TestCli_SetPrivateKey(t *testing.T) { } var ( - cli = &Cli{} + cli = &Cli{} + cfg = &config{} + rawConfig []byte - cfg *config ) rawConfig = tdata.Input[`config.ini`] - cfg, err = loadConfig(rawConfig) + err = cfg.UnmarshalText(rawConfig) if err != nil { t.Fatal(err) } @@ -185,7 +186,7 @@ func TestCli_SetPrivateKey(t *testing.T) { // Load the encrypted raw config and compare the issuer. - cfg, err = loadConfig(rawConfig) + err = cfg.UnmarshalText(rawConfig) if err != nil { t.Fatal(err) } -- cgit v1.3