Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: let Set to support custom type #3105

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

oldme-git
Copy link

Dear review:
Thanks for your reviewing

Set and other Set function can't use custom type. e.g.

func TestI(t *testing.T) {
  type myInt int
  var i myInt = 123

  err := rdb.Set(ctx, "key", i, 0).Err()
  if err != nil {
    t.Fatal(err)
  }
}

result: redis: can't marshal * (implement encoding.BinaryMarshaler)

It should add rereflect assertion after type assertion. I did it for performance and other types of considerations. for examole: time.Time or encoding.BinaryMarshaler

Have a good day!

fixed: #3104

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set and Set* don't support custom type
1 participant