api nil slice map
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
package apiresp
|
||||
|
||||
type ApiFormat interface {
|
||||
ApiFormat()
|
||||
}
|
||||
@@ -34,6 +34,9 @@ func isAllFieldsPrivate(v any) bool {
|
||||
}
|
||||
|
||||
func ApiSuccess(data any) *ApiResponse {
|
||||
if format, ok := data.(ApiFormat); ok {
|
||||
format.ApiFormat()
|
||||
}
|
||||
if isAllFieldsPrivate(data) {
|
||||
return &ApiResponse{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user