Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
hgiasac committed Oct 28, 2024
1 parent 83ddf71 commit 2a9b1a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion cmd/hasura-ndc-go/command/internal/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ var (
ndcScalarNameRegex = regexp.MustCompile(`^Scalar([A-Z]\w*)$`)
ndcScalarCommentRegex = regexp.MustCompile(`^@scalar(\s+(\w+))?(\s+([a-z]+))?$`)
ndcEnumCommentRegex = regexp.MustCompile(`^@enum\s+([\w-.,!@#$%^&*()+=~\s\t]+)$`)
packagePathRegex = regexp.MustCompile(`(([\w-\.]+/)+[a-z]+)\.`)
)

var (
Expand Down
11 changes: 5 additions & 6 deletions utils/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ type (
)

var (
errIntRequired = errors.New("the Int value must not be null")
errUintRequired = errors.New("the Uint value must not be null")
errValueTargetRequired = errors.New("the decoded target must be a pointer and not null")
errValueRequired = errors.New("the value must not be null")
errIntRequired = errors.New("the Int value must not be null")
errUintRequired = errors.New("the Uint value must not be null")
errValueRequired = errors.New("the value must not be null")
)

// ValueDecoder abstracts a type with the FromValue method to decode any value.
Expand Down Expand Up @@ -201,7 +200,7 @@ func DecodeObject[T any](value map[string]any, decodeHooks ...mapstructure.Decod

if t, ok := any(result).(ObjectDecoder); ok {
if err := t.FromValue(value); err != nil {
return *result, nil
return *result, err
}
}

Expand All @@ -222,7 +221,7 @@ func DecodeNullableObject[T any](value map[string]any, decodeHooks ...mapstructu

if t, ok := any(result).(ObjectDecoder); ok {
if err := t.FromValue(value); err != nil {
return nil, nil
return nil, err
}
}

Expand Down

0 comments on commit 2a9b1a0

Please sign in to comment.