MCPcopy Create free account
hub / github.com/golang/mobile / parseAndroidPlatformVersion

Function parseAndroidPlatformVersion

internal/sdkpath/sdkpath.go:90–109  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

88}
89
90func parseAndroidPlatformVersion(name string) (major int, minor int, ok bool) {
91 version, ok := strings.CutPrefix(name, "android-")
92 if !ok {
93 return 0, 0, false
94 }
95
96 majorString, minorString, hasMinor := strings.Cut(version, ".")
97 major, err := strconv.Atoi(majorString)
98 if err != nil {
99 return 0, 0, false
100 }
101 if !hasMinor {
102 return major, 0, true
103 }
104 minor, err = strconv.Atoi(minorString)
105 if err != nil {
106 return 0, 0, false
107 }
108 return major, minor, true
109}

Callers 1

AndroidAPIPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected