refactor: rename package errors to zerrors (#7039)

* chore: rename package errors to zerrors

* rename package errors to gerrors

* fix error related linting issues

* fix zitadel error assertion

* fix gosimple linting issues

* fix deprecated linting issues

* resolve gci linting issues

* fix import structure

---------

Co-authored-by: Elio Bischof <elio@zitadel.com>
This commit is contained in:
Tim Möhlmann
2023-12-08 16:30:55 +02:00
committed by GitHub
parent ddbea119f1
commit f680dd934d
798 changed files with 5809 additions and 5813 deletions

View File

@@ -4,7 +4,7 @@ import (
"context"
"database/sql"
"database/sql/driver"
errs "errors"
"errors"
"fmt"
"regexp"
"testing"
@@ -13,7 +13,7 @@ import (
"github.com/zitadel/zitadel/internal/database"
"github.com/zitadel/zitadel/internal/domain"
"github.com/zitadel/zitadel/internal/errors"
"github.com/zitadel/zitadel/internal/zerrors"
)
var (
@@ -203,7 +203,7 @@ func Test_OrgPrepares(t *testing.T) {
sql.ErrConnDone,
),
err: func(err error) (error, bool) {
if !errs.Is(err, sql.ErrConnDone) {
if !errors.Is(err, sql.ErrConnDone) {
return fmt.Errorf("err should be sql.ErrConnDone got: %w", err), false
}
return nil, true
@@ -221,7 +221,7 @@ func Test_OrgPrepares(t *testing.T) {
nil,
),
err: func(err error) (error, bool) {
if !errors.IsNotFound(err) {
if !zerrors.IsNotFound(err) {
return fmt.Errorf("err should be zitadel.NotFoundError got: %w", err), false
}
return nil, true
@@ -268,7 +268,7 @@ func Test_OrgPrepares(t *testing.T) {
sql.ErrConnDone,
),
err: func(err error) (error, bool) {
if !errs.Is(err, sql.ErrConnDone) {
if !errors.Is(err, sql.ErrConnDone) {
return fmt.Errorf("err should be sql.ErrConnDone got: %w", err), false
}
return nil, true
@@ -286,7 +286,7 @@ func Test_OrgPrepares(t *testing.T) {
nil,
),
err: func(err error) (error, bool) {
if !errors.IsInternal(err) {
if !zerrors.IsInternal(err) {
return fmt.Errorf("err should be zitadel.Internal got: %w", err), false
}
return nil, true
@@ -317,7 +317,7 @@ func Test_OrgPrepares(t *testing.T) {
sql.ErrConnDone,
),
err: func(err error) (error, bool) {
if !errs.Is(err, sql.ErrConnDone) {
if !errors.Is(err, sql.ErrConnDone) {
return fmt.Errorf("err should be sql.ErrConnDone got: %w", err), false
}
return nil, true
@@ -400,7 +400,7 @@ func TestQueries_IsOrgUnique(t *testing.T) {
},
want: want{
isUnique: false,
err: errors.IsErrorInvalidArgument,
err: zerrors.IsErrorInvalidArgument,
},
},
}