mirror of
https://github.com/yusing/godoxy.git
synced 2026-01-11 22:30:47 +01:00
style: fix some golangci-lint warnings
This commit is contained in:
@@ -9,9 +9,10 @@ import (
|
||||
|
||||
type (
|
||||
IconURL struct {
|
||||
FullURL *string `json:"value,omitempty"` // only for absolute/relative icons
|
||||
Extra *IconExtra `json:"extra,omitempty"` // only for walkxcode/selfhst icons
|
||||
IconSource `json:"source"`
|
||||
|
||||
FullURL *string `json:"value,omitempty"` // only for absolute/relative icons
|
||||
Extra *IconExtra `json:"extra,omitempty"` // only for walkxcode/selfhst icons
|
||||
}
|
||||
|
||||
IconExtra struct {
|
||||
|
||||
@@ -33,9 +33,10 @@ type (
|
||||
Tag string `json:"-"`
|
||||
}
|
||||
IconMetaSearch struct {
|
||||
*IconMeta
|
||||
|
||||
Source IconSource `json:"Source"`
|
||||
Ref string `json:"Ref"`
|
||||
*IconMeta
|
||||
|
||||
rank int
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import (
|
||||
|
||||
type ProxmoxProvider struct {
|
||||
*proxmox.Node
|
||||
|
||||
vmid int
|
||||
lxcName string
|
||||
running bool
|
||||
|
||||
@@ -67,6 +67,7 @@ type (
|
||||
|
||||
dependency struct {
|
||||
*Watcher
|
||||
|
||||
waitHealthy bool
|
||||
}
|
||||
|
||||
|
||||
@@ -99,13 +99,14 @@ func rotateLogFileByPolicy(file supportRotate, config *Retention) (result *Rotat
|
||||
var shouldStop func() bool
|
||||
t := utils.TimeNow()
|
||||
|
||||
if config.Last > 0 {
|
||||
switch {
|
||||
case config.Last > 0:
|
||||
shouldStop = func() bool { return result.NumLinesKeep-result.NumLinesInvalid == int(config.Last) }
|
||||
// not needed to parse time for last N lines
|
||||
} else if config.Days > 0 {
|
||||
case config.Days > 0:
|
||||
cutoff := utils.TimeNow().AddDate(0, 0, -int(config.Days)+1)
|
||||
shouldStop = func() bool { return t.Before(cutoff) }
|
||||
} else {
|
||||
default:
|
||||
return nil, nil // should not happen
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ type RouteContextKey struct{}
|
||||
|
||||
type RouteContext struct {
|
||||
context.Context
|
||||
|
||||
Route types.HTTPRoute
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user