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

In the api file, using `any` instead of `interface {}` report an error

Open anyone0034 opened this issue 2 years ago • 4 comments
trafficstars

Describe the bug In the api file, using any instead of interface {} report an error

  1. The code is

        PageHomeResp{
         PageConfig map[string]interface{} `json:"page_config"`
         PageConfig2 map[string]any `json:"page_config"`            //  report error
     }
    
  2. The error is

     can not found declaration 'any' in context
    

Environments (please complete the following information):

  • OS: windows
  • go-zero version [e.g. 1.2.1]:1.5.2
  • goctl version [e.g. 1.2.1, optional]:1.20.2

anyone0034 avatar Jul 30 '23 14:07 anyone0034

update goctl and go-zero

smithyj avatar Jul 31 '23 02:07 smithyj

goctl currently does not support any in the generated struct.

Mikaelemmmm avatar Jul 31 '23 08:07 Mikaelemmmm

interface{} doesn't work as well.

kevwan avatar Aug 05 '23 16:08 kevwan

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Aug 09 '24 01:08 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Nov 07 '24 02:11 github-actions[bot]