Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
841d7ef2
Commit
841d7ef2
authored
Jan 14, 2026
by
IanShaw027
Browse files
fix(lint): 修复 golangci-lint 检查问题
- 格式化代码(gofmt) - 修复空指针检查(staticcheck) - 删除未使用的函数(unused)
parent
a7a49be8
Changes
4
Hide whitespace changes
Inline
Side-by-side
backend/internal/handler/ops_error_logger.go
View file @
841d7ef2
...
@@ -1013,4 +1013,3 @@ func shouldSkipOpsErrorLog(ctx context.Context, ops *service.OpsService, message
...
@@ -1013,4 +1013,3 @@ func shouldSkipOpsErrorLog(ctx context.Context, ops *service.OpsService, message
return
false
return
false
}
}
backend/internal/repository/ops_repo.go
View file @
841d7ef2
...
@@ -967,13 +967,15 @@ func buildOpsErrorLogsWhere(filter *service.OpsErrorLogFilter) (string, []any) {
...
@@ -967,13 +967,15 @@ func buildOpsErrorLogsWhere(filter *service.OpsErrorLogFilter) (string, []any) {
args
=
append
(
args
,
phase
)
args
=
append
(
args
,
phase
)
clauses
=
append
(
clauses
,
"error_phase = $"
+
itoa
(
len
(
args
)))
clauses
=
append
(
clauses
,
"error_phase = $"
+
itoa
(
len
(
args
)))
}
}
if
owner
:=
strings
.
TrimSpace
(
strings
.
ToLower
(
filter
.
Owner
));
owner
!=
""
{
if
filter
!=
nil
{
args
=
append
(
args
,
owner
)
if
owner
:=
strings
.
TrimSpace
(
strings
.
ToLower
(
filter
.
Owner
));
owner
!=
""
{
clauses
=
append
(
clauses
,
"LOWER(COALESCE(error_owner,'')) = $"
+
itoa
(
len
(
args
)))
args
=
append
(
args
,
owner
)
}
clauses
=
append
(
clauses
,
"LOWER(COALESCE(error_owner,'')) = $"
+
itoa
(
len
(
args
)))
if
source
:=
strings
.
TrimSpace
(
strings
.
ToLower
(
filter
.
Source
));
source
!=
""
{
}
args
=
append
(
args
,
source
)
if
source
:=
strings
.
TrimSpace
(
strings
.
ToLower
(
filter
.
Source
));
source
!=
""
{
clauses
=
append
(
clauses
,
"LOWER(COALESCE(error_source,'')) = $"
+
itoa
(
len
(
args
)))
args
=
append
(
args
,
source
)
clauses
=
append
(
clauses
,
"LOWER(COALESCE(error_source,'')) = $"
+
itoa
(
len
(
args
)))
}
}
}
if
resolvedFilter
!=
nil
{
if
resolvedFilter
!=
nil
{
args
=
append
(
args
,
*
resolvedFilter
)
args
=
append
(
args
,
*
resolvedFilter
)
...
...
backend/internal/service/ops_service.go
View file @
841d7ef2
...
@@ -612,11 +612,3 @@ func sanitizeErrorBodyForStorage(raw string, maxBytes int) (sanitized string, tr
...
@@ -612,11 +612,3 @@ func sanitizeErrorBodyForStorage(raw string, maxBytes int) (sanitized string, tr
return
raw
,
false
return
raw
,
false
}
}
func
extractString
(
v
any
,
key
string
)
string
{
root
,
ok
:=
v
.
(
map
[
string
]
any
)
if
!
ok
{
return
""
}
s
,
_
:=
root
[
key
]
.
(
string
)
return
strings
.
TrimSpace
(
s
)
}
backend/internal/service/ops_settings_models.go
View file @
841d7ef2
...
@@ -78,13 +78,13 @@ type OpsAlertRuntimeSettings struct {
...
@@ -78,13 +78,13 @@ type OpsAlertRuntimeSettings struct {
// OpsAdvancedSettings stores advanced ops configuration (data retention, aggregation).
// OpsAdvancedSettings stores advanced ops configuration (data retention, aggregation).
type
OpsAdvancedSettings
struct
{
type
OpsAdvancedSettings
struct
{
DataRetention
OpsDataRetentionSettings
`json:"data_retention"`
DataRetention
OpsDataRetentionSettings
`json:"data_retention"`
Aggregation
OpsAggregationSettings
`json:"aggregation"`
Aggregation
OpsAggregationSettings
`json:"aggregation"`
IgnoreCountTokensErrors
bool
`json:"ignore_count_tokens_errors"`
IgnoreCountTokensErrors
bool
`json:"ignore_count_tokens_errors"`
IgnoreContextCanceled
bool
`json:"ignore_context_canceled"`
IgnoreContextCanceled
bool
`json:"ignore_context_canceled"`
IgnoreNoAvailableAccounts
bool
`json:"ignore_no_available_accounts"`
IgnoreNoAvailableAccounts
bool
`json:"ignore_no_available_accounts"`
AutoRefreshEnabled
bool
`json:"auto_refresh_enabled"`
AutoRefreshEnabled
bool
`json:"auto_refresh_enabled"`
AutoRefreshIntervalSec
int
`json:"auto_refresh_interval_seconds"`
AutoRefreshIntervalSec
int
`json:"auto_refresh_interval_seconds"`
}
}
type
OpsDataRetentionSettings
struct
{
type
OpsDataRetentionSettings
struct
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment