Skip to content

Commit

Permalink
chore: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
linzhengen committed Dec 29, 2024
1 parent b8f5276 commit 0ab435a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/application/seed.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ func (s seedApp) createMenus(ctx context.Context, parentID string, list SeedMenu
if err != nil {
return err
}

if &item != nil && item.Children != nil && len(item.Children) > 0 {
_item := &item
if _item != nil && item.Children != nil && len(item.Children) > 0 {
err := s.createMenus(ctx, menuID, item.Children)
if err != nil {
return err
Expand Down
6 changes: 3 additions & 3 deletions app/interfaces/api/gin.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,21 @@ func GetBody(c *gin.Context) []byte {

func ParseJSON(c *gin.Context, obj interface{}) error {
if err := c.ShouldBindJSON(obj); err != nil {
return errors2.Wrap400Response(err, "400 Bad Request - "+err.Error())
return errors2.Wrap400Response(err, "400 Bad Request - %v", err)
}
return nil
}

func ParseQuery(c *gin.Context, obj interface{}) error {
if err := c.ShouldBindQuery(obj); err != nil {
return errors2.Wrap400Response(err, "400 Bad Request - "+err.Error())
return errors2.Wrap400Response(err, "400 Bad Request - %v", err)
}
return nil
}

func ParseForm(c *gin.Context, obj interface{}) error {
if err := c.ShouldBindWith(obj, binding.Form); err != nil {
return errors2.Wrap400Response(err, "400 Bad Request - "+err.Error())
return errors2.Wrap400Response(err, "400 Bad Request - %v", err)
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion configs/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (h LogHook) IsMongo() bool {
}

type Log struct {
Level int
Level uint32
Format string
Output string
OutputFile string
Expand Down
4 changes: 2 additions & 2 deletions pkg/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ func StandardLogger() *Logger {
return logrus.StandardLogger()
}

func SetLevel(level int) {
logrus.SetLevel(logrus.Level(uint32(level)))
func SetLevel(level uint32) {
logrus.SetLevel(logrus.Level(level))
}

func SetFormatter(format string) {
Expand Down

0 comments on commit 0ab435a

Please sign in to comment.