cmd/gomobile: remove unnecessary IsDir check

The check when looking for android platform is unnecessarily stringent
in that the error would be caught by the call to os.Stat, and
it fails when the android platform folder is a symlink,
which is the case when developing on NixOs.

Change-Id: I07a96c969ffa29dea8bf8e353264e8597dcdc550
GitHub-Last-Rev: c684b80402ad30ad52eb854951aab69657ad7a5d
GitHub-Pull-Request: golang/mobile#55
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/267081
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Trust: Heschi Kreinick <heschi@google.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This commit is contained in:
Joseph Morag
2021-06-14 20:29:36 +00:00
committed by Hyang-Ah Hana Kim
parent 7e972142eb
commit 7c8f154d10
+1 -1
View File
@@ -393,7 +393,7 @@ func androidAPIPath() (string, error) {
var apiVer int
for _, fi := range fis {
name := fi.Name()
if !fi.IsDir() || !strings.HasPrefix(name, "android-") {
if !strings.HasPrefix(name, "android-") {
continue
}
n, err := strconv.Atoi(name[len("android-"):])