From 42d97d54cee6130183c5b76a2c5d7c313ab032ba Mon Sep 17 00:00:00 2001 From: John Maguire Date: Fri, 5 Apr 2024 23:23:41 -0400 Subject: [PATCH] feat: use amd64 restic for arm64 Windows (#201) --- internal/resticinstaller/resticinstaller.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/resticinstaller/resticinstaller.go b/internal/resticinstaller/resticinstaller.go index 46774da6..4b0bd62f 100644 --- a/internal/resticinstaller/resticinstaller.go +++ b/internal/resticinstaller/resticinstaller.go @@ -41,7 +41,12 @@ func resticBinName() string { func resticDownloadURL(version string) string { if runtime.GOOS == "windows" { - return fmt.Sprintf("https://github.com/restic/restic/releases/download/v%v/restic_%v_windows_%v.zip", version, version, runtime.GOARCH) + // restic is only built for 386 and amd64 on Windows, default to amd64 for other platforms (e.g. arm64.) + arch := "amd64" + if runtime.GOARCH == "386" || runtime.GOARCH == "amd64" { + arch = runtime.GOARCH + } + return fmt.Sprintf("https://github.com/restic/restic/releases/download/v%v/restic_%v_windows_%v.zip", version, version, arch) } return fmt.Sprintf("https://github.com/restic/restic/releases/download/v%v/restic_%v_%v_%v.bz2", version, version, runtime.GOOS, runtime.GOARCH) }