MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / LoadArchWithStdout

Function LoadArchWithStdout

core/utils/common/common.go:156–176  ·  view source on GitHub ↗
(std string)

Source from the content-addressed store, hash-verified

154 return LoadArchWithStdout(std)
155}
156func 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
178func Clean(str []byte) {
179 for i := 0; i < len(str); i++ {

Callers 1

LoadArchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected