fix more issues

Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
yxxhero 2025-02-27 22:02:35 +08:00
parent 8a92d2d1d8
commit ef6fb5b344
1 changed files with 2 additions and 4 deletions

View File

@ -391,12 +391,10 @@ func RequiredEnv(name string) (string, error) {
func Required(warn string, val any) (any, error) {
if val == nil {
// nolint:govet,staticcheck
return nil, fmt.Errorf(warn)
return nil, fmt.Errorf("%s", warn)
} else if _, ok := val.(string); ok {
if val == "" {
// nolint:govet,staticcheck
return nil, fmt.Errorf(warn)
return nil, fmt.Errorf("%s", warn)
}
}