mirror of
https://github.com/helm/helm.git
synced 2026-05-28 04:35:48 -04:00
refactor: replace if MatchString with FindStringSubMatch
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
This commit is contained in:
parent
782f6c6409
commit
65084371c9
1 changed files with 2 additions and 4 deletions
|
|
@ -382,8 +382,7 @@ func reformatExecErrorMsg(filename string, err error) error {
|
|||
}
|
||||
|
||||
var traceable TraceableError
|
||||
if execErrFmt.MatchString(current.Error()) {
|
||||
matches := execErrFmt.FindStringSubmatch(current.Error())
|
||||
if matches := execErrFmt.FindStringSubmatch(current.Error()); matches != nil {
|
||||
templateName := matches[execErrFmt.SubexpIndex("templateName")]
|
||||
functionName := matches[execErrFmt.SubexpIndex("functionName")]
|
||||
locationName := matches[execErrFmt.SubexpIndex("location")]
|
||||
|
|
@ -393,8 +392,7 @@ func reformatExecErrorMsg(filename string, err error) error {
|
|||
message: errMsg,
|
||||
executedFunction: "executing " + functionName + " at " + locationName + ":",
|
||||
}
|
||||
} else if execErrFmtWithoutTemplate.MatchString(current.Error()) {
|
||||
matches := execErrFmt.FindStringSubmatch(current.Error())
|
||||
} else if matches := execErrFmtWithoutTemplate.FindStringSubmatch(current.Error()); matches != nil {
|
||||
templateName := matches[execErrFmt.SubexpIndex("templateName")]
|
||||
errMsg := matches[execErrFmt.SubexpIndex("errMsg")]
|
||||
traceable = TraceableError{
|
||||
|
|
|
|||
Loading…
Reference in a new issue