add a helper function (#443)

This commit is contained in:
UUBulb authored and GitHub committed 2024-10-21 12:11:02 +08:00
1 parent 80740ddf39
commit 2699627df5
4 files changed
+21 -6

No files matched your search

+1 -1
View File
@@ -27,7 +27,7 @@ func listServerGroup(c *gin.Context) {
c.JSON(http.StatusOK, model.CommonResponse[[]model.ServerGroup]{
Success: err == nil,
Data: sg,
Error: utils.IfOrFn[string](err == nil, func() string {
Error: utils.IfOrFn(err == nil, func() string {
return err.Error()
}, func() string {
return ""