mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-02 10:31:04 +08:00
fix: resolve go vet warnings for non-constant format strings
- Replace log.Printf() with log.Print() for static strings - Fix 6 instances in trader/auto_trader.go (lines 262, 264, 351, 355, 359, 363) - Eliminates 'non-constant format string' warnings from go vet - No functional changes, output remains identical This follows Go best practices and improves code security by using appropriate logging functions for non-formatted strings.
This commit is contained in:
@@ -259,9 +259,9 @@ func (at *AutoTrader) Stop() {
|
||||
func (at *AutoTrader) runCycle() error {
|
||||
at.callCount++
|
||||
|
||||
log.Printf("\n" + strings.Repeat("=", 70))
|
||||
log.Print("\n" + strings.Repeat("=", 70))
|
||||
log.Printf("⏰ %s - AI决策周期 #%d", time.Now().Format("2006-01-02 15:04:05"), at.callCount)
|
||||
log.Printf(strings.Repeat("=", 70))
|
||||
log.Print(strings.Repeat("=", 70))
|
||||
|
||||
// 创建决策记录
|
||||
record := &logger.DecisionRecord{
|
||||
@@ -348,19 +348,19 @@ func (at *AutoTrader) runCycle() error {
|
||||
// 打印系统提示词和AI思维链(即使有错误,也要输出以便调试)
|
||||
if decision != nil {
|
||||
if decision.SystemPrompt != "" {
|
||||
log.Printf("\n" + strings.Repeat("=", 70))
|
||||
log.Print("\n" + strings.Repeat("=", 70))
|
||||
log.Printf("📋 系统提示词 [模板: %s] (错误情况)", at.systemPromptTemplate)
|
||||
log.Println(strings.Repeat("=", 70))
|
||||
log.Println(decision.SystemPrompt)
|
||||
log.Printf(strings.Repeat("=", 70) + "\n")
|
||||
log.Print(strings.Repeat("=", 70) + "\n")
|
||||
}
|
||||
|
||||
if decision.CoTTrace != "" {
|
||||
log.Printf("\n" + strings.Repeat("-", 70))
|
||||
log.Print("\n" + strings.Repeat("-", 70))
|
||||
log.Println("💭 AI思维链分析(错误情况):")
|
||||
log.Println(strings.Repeat("-", 70))
|
||||
log.Println(decision.CoTTrace)
|
||||
log.Printf(strings.Repeat("-", 70) + "\n")
|
||||
log.Print(strings.Repeat("-", 70) + "\n")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user