You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
whene run swag init , it report error: "Error parsing type definition 'res.Result-map[string]dashboard_DailyStatistics': data: cannot find type definition: map[string]dashboard.DailyStatistics"
type Result[T any] struct {
Code int64 json:"code" // 返回码,正常返回 0;错误时返回对应错误码
ErrorMsg string json:"err_msg,omitempty" // 错误信息,错误时返回
Data T json:"data,omitempty" // 返回内容,正常时返回
RequestID string json:"request_id" // 请求跟踪 ID (Trace ID)
}
The text was updated successfully, but these errors were encountered:
marsberrys
changed the title
why can not use map type in generics ?
Can not use map type in generics ?
Dec 7, 2023
marsberrys
changed the title
Can not use map type in generics ?
How to use map type in generics ?
Dec 7, 2023
// @response 200 {object} res.Result[map[string]dashboard.DailyStatistics]
whene run swag init , it report error: "Error parsing type definition 'res.Result-map[string]dashboard_DailyStatistics': data: cannot find type definition: map[string]dashboard.DailyStatistics"
type Result[T any] struct {
Code int64
json:"code"
// 返回码,正常返回 0;错误时返回对应错误码ErrorMsg string
json:"err_msg,omitempty"
// 错误信息,错误时返回Data T
json:"data,omitempty"
// 返回内容,正常时返回RequestID string
json:"request_id"
// 请求跟踪 ID (Trace ID)}
The text was updated successfully, but these errors were encountered: