From 0fd915a2eecfc5c76502990ab479dcc69de7baf5 Mon Sep 17 00:00:00 2001 From: yarnom Date: Tue, 14 Oct 2025 13:26:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/weatherstationctl/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/weatherstationctl/main.go b/cmd/weatherstationctl/main.go index 9cec0df..0d9c4d9 100644 --- a/cmd/weatherstationctl/main.go +++ b/cmd/weatherstationctl/main.go @@ -32,7 +32,8 @@ func main() { for _, svc := range serviceDirs { out := filepath.Join(binDir, svc) - pkg := filepath.ToSlash(filepath.Join("./cmd", svc)) + // 必须使用相对前缀 ./,否则 go 会将其当成标准库/模块路径 + pkg := "./" + filepath.ToSlash(filepath.Join("cmd", svc)) fmt.Printf("编译 %s -> %s\n", pkg, out) if err := run("go", "build", "-o", out, pkg); err != nil { fatalf("编译失败 %s: %v", pkg, err)