From d109b06ecde0f748de03148579cafec8f3abef85 Mon Sep 17 00:00:00 2001 From: zyrouge Date: Wed, 8 Nov 2023 12:00:49 +0530 Subject: [PATCH] refactor: use index to find asset properly --- commands/self-update.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commands/self-update.go b/commands/self-update.go index 750d7f6..e52e56d 100644 --- a/commands/self-update.go +++ b/commands/self-update.go @@ -40,7 +40,8 @@ var SelfUpdateCommand = cli.Command{ } arch := utils.GetSystemArch() var asset *core.GithubApiReleaseAsset - for _, x := range release.Assets { + for i := range release.Assets { + x := release.Assets[i] if strings.HasSuffix(x.Name, arch) { asset = &x break