diff options
| author | YTCai <qazxcv367tasi@gmail.com> | 2022-11-16 03:18:09 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-15 14:18:09 -0500 |
| commit | 1c35fc5b387389051cef132516f8547f7f4e9aaa (patch) | |
| tree | 668e600e615e172a7688eec2f5b41e1d66648fa1 /cmd | |
| parent | ccb749f141b100934c550843098c547f21a95fd9 (diff) | |
fix: update application config sample & replace the deprecated ioutil pkg (#492)
* docs: update application config sample
Signed-off-by: CaiYueTing <qazxcv367tasi@gmail.com>
* fix: use os read/write instead of deprecated ioutil read/write package
Signed-off-by: CaiYueTing <qazxcv367tasi@gmail.com>
* fix: use io, os pkg instead of all of the ioutil pkg
Signed-off-by: CaiYueTing <qazxcv367tasi@gmail.com>
Signed-off-by: CaiYueTing <qazxcv367tasi@gmail.com>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/run.go | 3 | ||||
| -rw-r--r-- | cmd/template.go | 4 |
2 files changed, 3 insertions, 4 deletions
@@ -4,7 +4,6 @@ import ( "context" "errors" "fmt" - "io/ioutil" "os" "strings" "sync" @@ -62,7 +61,7 @@ func newRunCommand() *cobra.Command { // User can specify a path to a template used for Git commit messages if commitMessagePath != "" { - tpl, err := ioutil.ReadFile(commitMessagePath) + tpl, err := os.ReadFile(commitMessagePath) if err != nil { if errors.Is(err, os.ErrNotExist) { log.Warnf("commit message template at %s does not exist, using default", commitMessagePath) diff --git a/cmd/template.go b/cmd/template.go index c73fd30..4c6c925 100644 --- a/cmd/template.go +++ b/cmd/template.go @@ -2,7 +2,7 @@ package main import ( "fmt" - "io/ioutil" + "os" "text/template" "time" @@ -37,7 +37,7 @@ If PATH is not given, will show you the default message that is used. tplStr = common.DefaultGitCommitMessage } else { commitMessageTemplatePath = args[0] - tplData, err := ioutil.ReadFile(commitMessageTemplatePath) + tplData, err := os.ReadFile(commitMessageTemplatePath) if err != nil { log.Fatalf("%v", err) } |
