refactor: to use strings.Lines

This commit is contained in:
cui 2025-09-13 13:57:18 +08:00 committed by GitHub
parent 36c6cc203e
commit b482a9bf0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -123,7 +123,7 @@ func (a *HookAuth) GetValues(s string) {
s = strings.ReplaceAll(s, "\r\n", "\n")
// iterate input lines
for _, val := range strings.Split(s, "\n") {
for val := range strings.Lines(s) {
v := strings.SplitN(val, "=", 2)
// skips non key and value format