diff options
| author | Shulhan <ms@kilabit.info> | 2023-05-15 23:23:41 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-05-15 23:23:41 +0700 |
| commit | bb1160d3f13514bebcb81e89c082198c5278b89e (patch) | |
| tree | c46307c2c252c5dac2b8523f4be4cb019c3d550d /config.go | |
| parent | f59e59c029a0332e7fd63e0cd5ea7fb30eb7d991 (diff) | |
| download | gotp-bb1160d3f13514bebcb81e89c082198c5278b89e.tar.xz | |
all: load the private key in loadConfig
This changes require the loadPrivateKey method detached from Cli and
become function.
Diffstat (limited to 'config.go')
| -rw-r--r-- | config.go | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -77,6 +77,13 @@ func loadConfig(content []byte) (cfg *config, err error) { return nil, fmt.Errorf(`%s: %w`, logp, err) } + if len(cfg.PrivateKey) > 0 { + cfg.privateKey, err = loadPrivateKey(cfg.PrivateKey, nil) + if err != nil { + return nil, fmt.Errorf(`%s: %w`, logp, err) + } + } + return cfg, nil } |
