fix: Token 统计支持 M 单位并修复 lint 错误

- 用户仪表盘 Token 统计卡片支持 K/M 单位自动切换
- 更新 formatTokensK 工具函数支持百万级显示
- 修复 setup.go 中未检查返回值的 errcheck 错误
This commit is contained in:
shaw
2026-01-06 10:13:12 +08:00
parent 9731b961d0
commit 752882a022
3 changed files with 12 additions and 6 deletions

View File

@@ -39,8 +39,8 @@ func GetDataDir() string {
// Try to check if writable by creating a temp file
testFile := dockerDataDir + "/.write_test"
if f, err := os.Create(testFile); err == nil {
f.Close()
os.Remove(testFile)
_ = f.Close()
_ = os.Remove(testFile)
return dockerDataDir
}
}