refactor: fix lint errors; improve error handling

This commit is contained in:
yusing
2026-02-22 16:04:25 +08:00
parent 3a7d1f8b18
commit 0f78158c64
40 changed files with 191 additions and 136 deletions

View File

@@ -158,13 +158,14 @@ func parse(v string) (subject string, args []string, err error) {
buf.WriteRune('$')
}
if quote != 0 {
switch {
case quote != 0:
err = ErrUnterminatedQuotes
} else if brackets != 0 {
case brackets != 0:
err = ErrUnterminatedBrackets
} else if inEnvVar {
case inEnvVar:
err = ErrUnterminatedEnvVar
} else {
default:
flush(false)
}
if len(missingEnvVars) > 0 {