From 7c8f154d100840bc5828285bb390bbae1cb5a98c Mon Sep 17 00:00:00 2001 From: Joseph Morag Date: Mon, 14 Jun 2021 16:58:01 +0000 Subject: [PATCH] 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 Trust: Heschi Kreinick Run-TryBot: Hyang-Ah Hana Kim Reviewed-by: Hyang-Ah Hana Kim Reviewed-by: Rebecca Stambler --- cmd/gomobile/bind_androidapp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/gomobile/bind_androidapp.go b/cmd/gomobile/bind_androidapp.go index 88a5c86..9eb7ce6 100644 --- a/cmd/gomobile/bind_androidapp.go +++ b/cmd/gomobile/bind_androidapp.go @@ -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-"):])