diff --git a/config/config.go b/config/config.go index 1e5f9ae..0c63142 100644 --- a/config/config.go +++ b/config/config.go @@ -104,8 +104,10 @@ func initDirectory(conf *Config) { } } -var mode string -var logMode LogMode +var ( + mode string + logMode LogMode +) func IsDev() bool { return mode == "development" diff --git a/handler/admin/link.go b/handler/admin/link.go index d3e4518..b477878 100644 --- a/handler/admin/link.go +++ b/handler/admin/link.go @@ -78,7 +78,6 @@ func (l *LinkHandler) UpdateLink(ctx *gin.Context) (interface{}, error) { } linkParam := ¶m.Link{} err = ctx.ShouldBindJSON(linkParam) - if err != nil { e := validator.ValidationErrors{} if errors.As(err, &e) { diff --git a/handler/admin/menu.go b/handler/admin/menu.go index bbeeffe..3cb7818 100644 --- a/handler/admin/menu.go +++ b/handler/admin/menu.go @@ -136,7 +136,6 @@ func (m *MenuHandler) UpdateMenu(ctx *gin.Context) (interface{}, error) { } menuParam := ¶m.Menu{} err = ctx.ShouldBindJSON(menuParam) - if err != nil { e := validator.ValidationErrors{} if errors.As(err, &e) { diff --git a/handler/admin/tag.go b/handler/admin/tag.go index 29b67fe..f518094 100644 --- a/handler/admin/tag.go +++ b/handler/admin/tag.go @@ -81,7 +81,6 @@ func (t *TagHandler) UpdateTag(ctx *gin.Context) (interface{}, error) { } tagParam := ¶m.Tag{} err = ctx.ShouldBindJSON(tagParam) - if err != nil { e := validator.ValidationErrors{} if errors.As(err, &e) {