lint: fix CI warnings and avoid named return parameters (#682)

This commit is contained in:
Nathan Baulch
2025-09-25 11:44:33 +10:00
committed by GitHub
parent 21a523ddc0
commit 52d31f788f
7 changed files with 95 additions and 71 deletions

View File

@@ -129,7 +129,7 @@ func Try(callback func() error) (ok bool) {
ok = false
}
return
return ok
}
// Try0 has the same behavior as Try, but callback returns no variable.
@@ -327,7 +327,7 @@ func TryWithErrorValue(callback func() error) (errorValue any, ok bool) {
errorValue = err
}
return
return errorValue, ok
}
// TryCatch has the same behavior as Try, but calls the catch function in case of error.