MCPcopy Create free account
hub / github.com/AndroidPoet/playconsole-cli / extractPlatform

Function extractPlatform

internal/api/github.go:169–190  ·  view source on GitHub ↗

extractPlatform extracts the platform from an asset name

(name string)

Source from the content-addressed store, hash-verified

167
168// extractPlatform extracts the platform from an asset name
169func extractPlatform(name string) string {
170 name = strings.ToLower(name)
171
172 switch {
173 case strings.Contains(name, "darwin_arm64"):
174 return "darwin_arm64"
175 case strings.Contains(name, "darwin_amd64"):
176 return "darwin_amd64"
177 case strings.Contains(name, "linux_arm64"):
178 return "linux_arm64"
179 case strings.Contains(name, "linux_amd64"):
180 return "linux_amd64"
181 case strings.Contains(name, "windows_arm64"):
182 return "windows_arm64"
183 case strings.Contains(name, "windows_amd64"):
184 return "windows_amd64"
185 case strings.Contains(name, "checksum"):
186 return "checksums"
187 default:
188 return "other"
189 }
190}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected