Skip to content

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

@ndyakov
Copy link
Member

ndyakov commented Feb 6, 2025

Hello @oldme-git, Would you mind adding a test case per type added in the reflect select ?

@ndyakov ndyakov self-requested a review February 6, 2025 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set and Set* don't support custom type
3 participants