archiveName maps the current runtime to the release asset filename.
()
| 105 | |
| 106 | // archiveName maps the current runtime to the release asset filename. |
| 107 | func archiveName() string { |
| 108 | goarch := runtime.GOARCH |
| 109 | goos := runtime.GOOS |
| 110 | ext := "tar.gz" |
| 111 | if goos == "windows" { |
| 112 | ext = "zip" |
| 113 | } |
| 114 | arch := goarch |
| 115 | if goarch == "arm" { |
| 116 | arch = "armv7" |
| 117 | } |
| 118 | return fmt.Sprintf("snix-%s-%s.%s", goos, arch, ext) |
| 119 | } |
| 120 | |
| 121 | // resolveLatest follows the /releases/latest redirect to learn the tag |
| 122 | // without needing the GitHub API (which is rate-limited for unauth users). |