0
0
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:
Beatriz Vieira 2023-01-14 23:56:05 -03:00
parent 5e2ea6bdeb
commit eea20ebf6b
2 changed files with 5 additions and 6 deletions

View File

@ -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: "",
},
}

View File

@ -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
}