| 156 | } |
| 157 | |
| 158 | func getBinaryURL(manifest map[string]interface{}) (string, error) { |
| 159 | platforms, ok := manifest["platforms"].(map[string]interface{}) |
| 160 | if !ok { |
| 161 | return "", errors.New("no platforms key in kite manifest") |
| 162 | } |
| 163 | |
| 164 | platform := runtime.GOOS + "_" + runtime.GOARCH |
| 165 | |
| 166 | platformURL, ok := platforms[platform] |
| 167 | if !ok { |
| 168 | return "", fmt.Errorf("no binary available for platform: %s", platform) |
| 169 | } |
| 170 | |
| 171 | binaryURL, ok := platformURL.(string) |
| 172 | if !ok { |
| 173 | return "", errors.New("invalid platform URL") |
| 174 | } |
| 175 | |
| 176 | return binaryURL, nil |
| 177 | } |
| 178 | |
| 179 | func getVersion(manifest map[string]interface{}) (string, error) { |
| 180 | version, ok := manifest["version"].(string) |