mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-17 23:28:50 +00:00
Technical depth: Adding Go linter to CI (#734)
This commit is contained in:
@@ -5,6 +5,8 @@ import (
|
||||
"errors"
|
||||
"mizuserver/pkg/config"
|
||||
|
||||
"github.com/up9inc/mizu/shared/logger"
|
||||
|
||||
ory "github.com/ory/kratos-client-go"
|
||||
)
|
||||
|
||||
@@ -38,7 +40,9 @@ func CreateAdminUser(password string, ctx context.Context) (token *string, err e
|
||||
|
||||
if err != nil {
|
||||
//Delete the user to prevent a half-setup situation where admin user is created without admin privileges
|
||||
DeleteUser(identityId, ctx)
|
||||
if err := DeleteUser(identityId, ctx); err != nil {
|
||||
logger.Log.Error(err)
|
||||
}
|
||||
|
||||
return nil, err, nil
|
||||
}
|
||||
|
@@ -85,11 +85,11 @@ func DeleteUser(identityId string, ctx context.Context) error {
|
||||
return err
|
||||
}
|
||||
if result == nil {
|
||||
return errors.New("unknown error occured during user deletion")
|
||||
return fmt.Errorf("unknown error occured during user deletion %v", identityId)
|
||||
}
|
||||
|
||||
if result.StatusCode < 200 || result.StatusCode > 299 {
|
||||
return errors.New(fmt.Sprintf("user deletion returned bad status %d", result.StatusCode))
|
||||
return fmt.Errorf("user deletion %v returned bad status %d", identityId, result.StatusCode)
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user