mirror of
https://github.com/thegeeklab/git-sv.git
synced 2024-11-21 12:00:40 +00:00
refactor: change ioutil.ReadFile to os.ReadFile
This commit is contained in:
parent
5e2ea6bdeb
commit
eea20ebf6b
@ -2,8 +2,8 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"reflect"
|
||||
"strings"
|
||||
@ -53,7 +53,7 @@ func combinedOutputErr(err error, out []byte) error {
|
||||
}
|
||||
|
||||
func readConfig(filepath string) (Config, error) {
|
||||
content, rerr := ioutil.ReadFile(filepath)
|
||||
content, rerr := os.ReadFile(filepath)
|
||||
if rerr != nil {
|
||||
return Config{}, rerr
|
||||
}
|
||||
@ -79,7 +79,7 @@ func defaultConfig() Config {
|
||||
},
|
||||
Tag: sv.TagConfig{
|
||||
Pattern: "%d.%d.%d",
|
||||
Filter: "",
|
||||
Filter: "",
|
||||
},
|
||||
ReleaseNotes: sv.ReleaseNotesConfig{
|
||||
Sections: []sv.ReleaseNotesSectionConfig{
|
||||
@ -101,7 +101,7 @@ func defaultConfig() Config {
|
||||
Footer: map[string]sv.CommitMessageFooterConfig{
|
||||
"issue": {Key: "jira", KeySynonyms: []string{"Jira", "JIRA"}},
|
||||
},
|
||||
Issue: sv.CommitMessageIssueConfig{Regex: "[A-Z]+-[0-9]+"},
|
||||
Issue: sv.CommitMessageIssueConfig{Regex: "[A-Z]+-[0-9]+"},
|
||||
HeaderSelector: "",
|
||||
},
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ package main
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
@ -500,7 +499,7 @@ func validateCommitMessageHandler(git sv.Git, messageProcessor sv.MessageProcess
|
||||
}
|
||||
|
||||
func readFile(filepath string) (string, error) {
|
||||
f, err := ioutil.ReadFile(filepath)
|
||||
f, err := os.ReadFile(filepath)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user