Skip to content

Commit

Permalink
x/shared: JSONMarshal now has type inference
Browse files Browse the repository at this point in the history
  • Loading branch information
widmogrod committed Mar 3, 2024
1 parent 49c4044 commit be82a54
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion x/shared/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ func JSONUnmarshal[A any](data []byte) (A, error) {
return result.(A), nil
}

func JSONMarshal[A any](x any) ([]byte, error) {
func JSONMarshal[A any](in A) ([]byte, error) {
x := any(in)
if x == nil {
return nil, nil
}
Expand Down

0 comments on commit be82a54

Please sign in to comment.