From 35e56c5af956ac30e77e468f1c0a70083a2e29b2 Mon Sep 17 00:00:00 2001 From: Inkeliz Date: Sat, 7 May 2022 16:14:54 +0100 Subject: [PATCH] gogio: refuse compilation with additional arguments Previously, it was possible to misuse gigio with arguments after the package, such as `gogio -target android . -o foo.apk`. That cause an undesired effect, since `-o` is silently ignore by gogio. Now, any arguments after the package will trigger an error. Signed-off-by: Inkeliz --- gogio/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gogio/main.go b/gogio/main.go index 38018f7..b52c294 100644 --- a/gogio/main.go +++ b/gogio/main.go @@ -65,6 +65,9 @@ func flagValidate() error { if pkgPathArg == "" { return errors.New("specify a package") } + if len(flag.Args()) > 1 { + return fmt.Errorf("build arguments must be specified before the package (%q)", pkgPathArg) + } if *target == "" { return errors.New("please specify -target") }