cmd/gogio: fix a couple of staticcheck positives

Spotted the javac one by chance when reading the code, so I ran the tool
and fixed another small bug while at it.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
This commit is contained in:
Daniel Martí
2019-11-03 19:14:16 +00:00
committed by Elias Naur
parent 2bee95358a
commit ec0c2498a1
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -151,6 +151,9 @@ func compileAndroid(tmpDir string, tools *androidTools, bi *buildInfo) (err erro
return errors.New("ANDROID_HOME is not set. Please point it to the root of the Android SDK")
}
javac, err := findJavaC()
if err != nil {
return fmt.Errorf("could not find javac: %v", err)
}
ndkRoot := filepath.Join(androidHome, "ndk-bundle")
if _, err := os.Stat(ndkRoot); err != nil {
return fmt.Errorf("no NDK found in $ANDROID_HOME/ndk-bundle (%s). Use `sdkmanager ndk-bundle` to install it", ndkRoot)
+1 -1
View File
@@ -47,7 +47,7 @@ type buildInfo struct {
func main() {
flag.Usage = func() {
fmt.Fprintf(os.Stderr, mainUsage)
fmt.Fprint(os.Stderr, mainUsage)
}
flag.Parse()
if err := mainErr(); err != nil {