go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

redis HmsetCtx and Hmset params type :fieldsAndValues map[string]string why not fieldsAndValues map[string]any

Open zhouzun8709 opened this issue 1 year ago • 2 comments
trafficstars

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior, if applicable:

  1. The code is

image image

  1. The error is

    
    

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Environments (please complete the following information):

  • OS: [e.g. Linux]
  • go-zero version 1.6.1
  • goctl version [e.g. 1.2.1, optional]

More description Add any other context about the problem here.

zhouzun8709 avatar Dec 25 '23 03:12 zhouzun8709

Let me open a PR for this issue!

POABOB avatar Dec 26 '23 14:12 POABOB

Personal opinion: If "any" is used here, passing in a value that is a map[string]string or another type could cause an error. Therefore, I believe that specifying the parameter as map[string]string could reduce the likelihood of such errors occurring. I think there should be no need to make changes here. image

codeErrorSleep avatar Dec 28 '23 05:12 codeErrorSleep