Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinZonda committed Jun 5, 2024
1 parent 1b1df8e commit 26c07f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/jsonx/BytesObj.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func BytesToObjE[T any](s []byte) (T, error) {
func BytesToObjPtr[T any](s []byte) *T {
var v T
err := json.Unmarshal(s, &v)
if err != nil || v == nil {
if err != nil {
return nil
}
return &v
Expand All @@ -29,7 +29,7 @@ func BytesToObjPtr[T any](s []byte) *T {
func BytesToObjPtrE[T any](s []byte) (*T, error) {
var v T
err := json.Unmarshal(s, &v)
if err != nil || v == nil {
if err != nil {
return nil, err
}
return &v, nil
Expand Down

0 comments on commit 26c07f9

Please sign in to comment.