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

monolithic-service uses generics to simplify registering Handler routing

Open spatxos opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe. The go language monolithic-service generated by goctl is simplified with generics

Describe the solution you'd like Since go v1.18, generics have been introduced, which can be used to defer Handler handlers in order to defer Handlers added by routes to the actual Logic structure.

Describe alternatives you've considered Refer to BaseHandlerFunc and baselogic.go, then add Handler method to each logic.go structure, change HandlerFunc in routes.go to BaseHandlerFunc

Additional context go-zero单体服务使用泛型简化注册Handler路由

spatxos avatar Jul 28 '22 02:07 spatxos

Thanks, but we need to support go 1.16 at the moment.

kevwan avatar Aug 18 '22 01:08 kevwan

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

github-actions[bot] avatar Aug 18 '23 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 Mar 19 '24 01:03 github-actions[bot]