优化代码

This commit is contained in:
hero920103 committed 2026-10-28 08:47:09 +08:00
1 parent 3553790475
commit eda7e8bc96
23 files changed
+3113 -342

No files matched your search

+3 -3
View File
@@ -1,10 +1,10 @@
# Build viewsagent for Windows (no console window).
# Usage: .\build.ps1
# Requires: Go 1.24+ and gcc from MSYS2 mingw-w64 (C:\msys64\mingw64\bin).
# Requires: Go 1.24+ and gcc from MSYS2 mingw-w64 (E:\Tools\msys64\mingw64\bin).
$ErrorActionPreference = "Stop"
$mingw = "C:\msys64\mingw64\bin"
$mingw = "E:\Tools\msys64\mingw64\bin"
if (Test-Path $mingw) {
$env:Path = "$mingw;" + $env:Path
}
@@ -24,7 +24,7 @@ go test ./...
if ($LASTEXITCODE -ne 0) { Write-Error "tests failed, build aborted." }
Write-Host "==> go build" -ForegroundColor Cyan
go build -trimpath -ldflags "-H windowsgui -s -w" -o "bin\viewsagent.exe" .\cmd\viewsagent
go build -trimpath -ldflags "-H windowsgui -s -w" -o "bin\viewsagent.exe" .
if ($LASTEXITCODE -ne 0) { Write-Error "build failed." }
$mb = [math]::Round((Get-Item "bin\viewsagent.exe").Length / 1MB, 1)