From 456791ab32036f8b0c0ac4f8faa7f275b992ffd5 Mon Sep 17 00:00:00 2001 From: sky5454 Date: Tue, 31 Mar 2026 05:21:26 +0800 Subject: [PATCH] fix(ci): fix ci err --- cmd/picoclaw/main.go | 6 +++--- pkg/updater/updater.go | 9 ++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/cmd/picoclaw/main.go b/cmd/picoclaw/main.go index b11a456a4..48dffbb33 100644 --- a/cmd/picoclaw/main.go +++ b/cmd/picoclaw/main.go @@ -24,7 +24,7 @@ import ( "github.com/sipeed/picoclaw/cmd/picoclaw/internal/status" "github.com/sipeed/picoclaw/cmd/picoclaw/internal/version" "github.com/sipeed/picoclaw/pkg/config" - "github.com/sipeed/picoclaw/pkg/updater" + "github.com/sipeed/picoclaw/pkg/updater" ) func NewPicoclawCommand() *cobra.Command { @@ -46,8 +46,8 @@ func NewPicoclawCommand() *cobra.Command { migrate.NewMigrateCommand(), skills.NewSkillsCommand(), model.NewModelCommand(), - updater.NewUpdateCommand("picoclaw"), - version.NewVersionCommand(), + updater.NewUpdateCommand("picoclaw"), + version.NewVersionCommand(), ) return cmd diff --git a/pkg/updater/updater.go b/pkg/updater/updater.go index 379205d9a..f5612fa8d 100644 --- a/pkg/updater/updater.go +++ b/pkg/updater/updater.go @@ -70,7 +70,7 @@ func DownloadAndExtractRelease(releaseURL, platform, arch string) (string, error return "", fmt.Errorf("failed to download asset: status %d", resp.StatusCode) } - if _, err := io.Copy(tmpFile, resp.Body); err != nil { + if _, err = io.Copy(tmpFile, resp.Body); err != nil { os.Remove(tmpPath) return "", err } @@ -119,7 +119,7 @@ func UpdateSelfFromRelease(releaseURL, platform, arch, programName string) error // ensure executable bit on non-windows if runtime.GOOS != "windows" { - _ = os.Chmod(binPath, 0755) + _ = os.Chmod(binPath, 0o755) } f, err := os.Open(binPath) @@ -312,7 +312,10 @@ func looksLikeDirectAssetURL(u string) bool { return false } lower := strings.ToLower(u) - if strings.HasSuffix(lower, ".zip") || strings.HasSuffix(lower, ".tar.gz") || strings.HasSuffix(lower, ".tgz") || strings.HasSuffix(lower, ".tar") { + if strings.HasSuffix(lower, ".zip") || + strings.HasSuffix(lower, ".tar.gz") || + strings.HasSuffix(lower, ".tgz") || + strings.HasSuffix(lower, ".tar") { return true } if strings.Contains(lower, "/releases/download/") {