2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 11:27:17 +08:00

fix: lint

This commit is contained in:
耗子
2024-05-29 21:38:59 +08:00
parent 1fbea148e3
commit a995c56f1b
3 changed files with 11 additions and 33 deletions

View File

@@ -2,7 +2,6 @@ package commands
import (
"context"
"strconv"
"github.com/goravel/framework/contracts/console"
"github.com/goravel/framework/contracts/console/command"
@@ -82,12 +81,7 @@ func (receiver *Monitoring) Handle(console.Context) error {
}
// 删除过期数据
monitorDays := setting.Get(models.SettingKeyMonitorDays)
days, err := strconv.Atoi(monitorDays)
if err != nil {
return nil
}
days := cast.ToInt(setting.Get(models.SettingKeyMonitorDays))
if days <= 0 || internal.Status != internal.StatusNormal {
return nil
}

View File

@@ -12,7 +12,9 @@ type QueueServiceProvider struct {
}
func (receiver *QueueServiceProvider) Register(app foundation.Application) {
facades.Queue().Register(receiver.Jobs())
if err := facades.Queue().Register(receiver.Jobs()); err != nil {
panic(err.Error())
}
}
func (receiver *QueueServiceProvider) Boot(app foundation.Application) {

View File

@@ -4,8 +4,8 @@ package tools
import (
"errors"
"fmt"
"github.com/spf13/cast"
"os"
"strconv"
"strings"
"time"
@@ -101,30 +101,12 @@ func GenerateVersions(start, end string) ([]string, error) {
return nil, fmt.Errorf("版本格式错误")
}
startMajor, err := strconv.Atoi(startParts[0])
if err != nil {
return nil, fmt.Errorf("无效的起始主版本号: %v", err)
}
startMinor, err := strconv.Atoi(startParts[1])
if err != nil {
return nil, fmt.Errorf("无效的起始次版本号: %v", err)
}
startPatch, err := strconv.Atoi(startParts[2])
if err != nil {
return nil, fmt.Errorf("无效的起始修订号: %v", err)
}
endMajor, err := strconv.Atoi(endParts[0])
if err != nil {
return nil, fmt.Errorf("无效的结束主版本号: %v", err)
}
endMinor, err := strconv.Atoi(endParts[1])
if err != nil {
return nil, fmt.Errorf("无效的结束次版本号: %v", err)
}
endPatch, err := strconv.Atoi(endParts[2])
if err != nil {
return nil, fmt.Errorf("无效的结束修订号: %v", err)
}
startMajor := cast.ToInt(startParts[0])
startMinor := cast.ToInt(startParts[1])
startPatch := cast.ToInt(startParts[2])
endMajor := cast.ToInt(endParts[0])
endMinor := cast.ToInt(endParts[1])
endPatch := cast.ToInt(endParts[2])
for major := startMajor; major <= endMajor; major++ {
for minor := 0; minor <= 99; minor++ {