fix(niki): patch linter errors

This commit is contained in:
Iman Mirazimi 2024-01-01 12:01:10 +03:30
parent bc440a26ad
commit fa3ec8bb10
16 changed files with 32 additions and 32 deletions

View File

@ -69,7 +69,7 @@ func (r RichError) Kind() Kind {
}
var re *RichError
if !errors.As(r.wrappedError, re) {
if !errors.As(r.wrappedError, &re) {
return 0
}
@ -82,7 +82,7 @@ func (r RichError) Message() string {
}
var re *RichError
if !errors.As(r.wrappedError, re) {
if !errors.As(r.wrappedError, &re) {
return r.wrappedError.Error()
}

View File

@ -29,9 +29,9 @@ func (v Validator) ValidateAdminAddRequest(req param.KindBoxAddRequest) (map[str
); err != nil {
fieldErrors := make(map[string]string)
var errV validation.Errors
var errV *validation.Errors
if errors.As(err, &errV) {
for key, value := range errV {
for key, value := range *errV {
if value != nil {
fieldErrors[key] = value.Error()
}

View File

@ -25,9 +25,9 @@ func (v Validator) ValidateDeleteRequest(req param.KindBoxDeleteRequest) (map[st
); err != nil {
fieldErrors := make(map[string]string)
var errV validation.Errors
var errV *validation.Errors
if errors.As(err, &errV) {
for key, value := range errV {
for key, value := range *errV {
if value != nil {
fieldErrors[key] = value.Error()
}

View File

@ -24,9 +24,9 @@ func (v Validator) ValidateGetByIDRequest(req param.KindBoxGetRequest) (map[stri
); err != nil {
fieldErrors := make(map[string]string)
var errV validation.Errors
var errV *validation.Errors
if errors.As(err, &errV) {
for key, value := range errV {
for key, value := range *errV {
if value != nil {
fieldErrors[key] = value.Error()
}

View File

@ -39,9 +39,9 @@ func (v Validator) ValidateUpdateRequest(req param.KindBoxUpdateRequest) (map[st
); err != nil {
fieldErrors := make(map[string]string)
var errV validation.Errors
var errV *validation.Errors
if errors.As(err, &errV) {
for key, value := range errV {
for key, value := range *errV {
if value != nil {
fieldErrors[key] = value.Error()
}

View File

@ -26,9 +26,9 @@ func (v Validator) ValidateAddRequest(req param.KindBoxReqAddRequest) (map[strin
); err != nil {
fieldErrors := make(map[string]string)
var errV validation.Errors
var errV *validation.Errors
if errors.As(err, &errV) {
for key, value := range errV {
for key, value := range *errV {
if value != nil {
fieldErrors[key] = value.Error()
}

View File

@ -25,9 +25,9 @@ func (v Validator) ValidateDeleteRequest(req param.KindBoxReqDeleteRequest) (map
); err != nil {
fieldErrors := make(map[string]string)
var errV validation.Errors
var errV *validation.Errors
if errors.As(err, &errV) {
for key, value := range errV {
for key, value := range *errV {
if value != nil {
fieldErrors[key] = value.Error()
}

View File

@ -24,9 +24,9 @@ func (v Validator) ValidateGetByIDRequest(req param.KindBoxReqGetRequest) (map[s
); err != nil {
fieldErrors := make(map[string]string)
var errV validation.Errors
var errV *validation.Errors
if errors.As(err, &errV) {
for key, value := range errV {
for key, value := range *errV {
if value != nil {
fieldErrors[key] = value.Error()
}

View File

@ -30,9 +30,9 @@ func (v Validator) ValidateUpdateRequest(req param.KindBoxReqUpdateRequest) (map
); err != nil {
fieldErrors := make(map[string]string)
var errV validation.Errors
var errV *validation.Errors
if errors.As(err, &errV) {
for key, value := range errV {
for key, value := range *errV {
if value != nil {
fieldErrors[key] = value.Error()
}

View File

@ -24,9 +24,9 @@ func (v Validator) ValidateGetByIDRequest(req param.KindBoxGetRequest) (map[stri
); err != nil {
fieldErrors := make(map[string]string)
var errV validation.Errors
var errV *validation.Errors
if errors.As(err, &errV) {
for key, value := range errV {
for key, value := range *errV {
if value != nil {
fieldErrors[key] = value.Error()
}

View File

@ -19,9 +19,9 @@ func (v Validator) ValidateUpdateRequest(req param.KindBoxGetAllRequest) (map[st
); err != nil {
fieldErrors := make(map[string]string)
var errV validation.Errors
var errV *validation.Errors
if errors.As(err, &errV) {
for key, value := range errV {
for key, value := range *errV {
if value != nil {
fieldErrors[key] = value.Error()
}

View File

@ -26,9 +26,9 @@ func (v Validator) ValidateAddRequest(req param.KindBoxReqAddRequest) (map[strin
); err != nil {
fieldErrors := make(map[string]string)
var errV validation.Errors
var errV *validation.Errors
if errors.As(err, &errV) {
for key, value := range errV {
for key, value := range *errV {
if value != nil {
fieldErrors[key] = value.Error()
}

View File

@ -25,9 +25,9 @@ func (v Validator) ValidateDeleteRequest(req param.KindBoxReqDeleteRequest) (map
); err != nil {
fieldErrors := make(map[string]string)
var errV validation.Errors
var errV *validation.Errors
if errors.As(err, &errV) {
for key, value := range errV {
for key, value := range *errV {
if value != nil {
fieldErrors[key] = value.Error()
}

View File

@ -24,9 +24,9 @@ func (v Validator) ValidateGetRequest(req param.KindBoxReqGetRequest) (map[strin
); err != nil {
fieldErrors := make(map[string]string)
var errV validation.Errors
var errV *validation.Errors
if errors.As(err, &errV) {
for key, value := range errV {
for key, value := range *errV {
if value != nil {
fieldErrors[key] = value.Error()
}

View File

@ -19,9 +19,9 @@ func (v Validator) ValidateGetAllRequest(req param.KindBoxReqGetAllRequest) (map
); err != nil {
fieldErrors := make(map[string]string)
var errV validation.Errors
var errV *validation.Errors
if errors.As(err, &errV) {
for key, value := range errV {
for key, value := range *errV {
if value != nil {
fieldErrors[key] = value.Error()
}

View File

@ -31,9 +31,9 @@ func (v Validator) ValidateUpdateRequest(req param.KindBoxReqUpdateRequest) (map
); err != nil {
fieldErrors := make(map[string]string)
var errV validation.Errors
var errV *validation.Errors
if errors.As(err, &errV) {
for key, value := range errV {
for key, value := range *errV {
if value != nil {
fieldErrors[key] = value.Error()
}