| 154 | return LoadArchWithStdout(std) |
| 155 | } |
| 156 | func LoadArchWithStdout(std string) (string, error) { |
| 157 | if strings.Contains(std, "x86_64") { |
| 158 | return "amd64", nil |
| 159 | } |
| 160 | if strings.Contains(std, "arm64") || strings.Contains(std, "aarch64") { |
| 161 | return "arm64", nil |
| 162 | } |
| 163 | if strings.Contains(std, "armv7l") { |
| 164 | return "armv7", nil |
| 165 | } |
| 166 | if strings.Contains(std, "ppc64le") { |
| 167 | return "ppc64le", nil |
| 168 | } |
| 169 | if strings.Contains(std, "s390x") { |
| 170 | return "s390x", nil |
| 171 | } |
| 172 | if strings.Contains(std, "riscv64") { |
| 173 | return "riscv64", nil |
| 174 | } |
| 175 | return "", fmt.Errorf("unsupported such arch: %s", std) |
| 176 | } |
| 177 | |
| 178 | func Clean(str []byte) { |
| 179 | for i := 0; i < len(str); i++ { |