cmd/gomobile: bump required Go version to 1.10
Go 1.9 is probably enough, but I'm not willing to support it.
Fixes golang/go#29486
Change-Id: I6dac22dbbd527d6668c5951d9060617efb758b96
Reviewed-on: https://go-review.googlesource.com/c/156137
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/cmd/gomobile/doc.go b/cmd/gomobile/doc.go
index 7b479c8..059e4d8 100644
--- a/cmd/gomobile/doc.go
+++ b/cmd/gomobile/doc.go
@@ -12,7 +12,7 @@
$ go get golang.org/x/mobile/cmd/gomobile
$ gomobile init
-At least Go 1.7 is required.
+At least Go 1.10 is required.
For detailed instructions, see https://golang.org/wiki/Mobile.
Usage:
@@ -103,6 +103,9 @@
If the package directory contains an assets subdirectory, its contents
are copied into the output.
+Flag -iosversion sets the minimal version of the iOS SDK to compile against.
+The default version is 6.1.
+
The -bundleid flag is for -target ios only and sets the bundle ID to use
with the app; defaults to "org.golang.todo".
diff --git a/cmd/gomobile/main.go b/cmd/gomobile/main.go
index 86ac27d..b40379f 100644
--- a/cmd/gomobile/main.go
+++ b/cmd/gomobile/main.go
@@ -93,11 +93,13 @@
if err != nil {
return fmt.Errorf("'go version' failed: %v, %s", err, goVersionOut)
}
- switch {
- case bytes.HasPrefix(goVersionOut, []byte("go version go1.4")),
- bytes.HasPrefix(goVersionOut, []byte("go version go1.5")),
- bytes.HasPrefix(goVersionOut, []byte("go version go1.6")):
- return errors.New("Go 1.7 or newer is required")
+ var minor int
+ if _, err := fmt.Sscanf(string(goVersionOut), "go version go1.%d", &minor); err != nil {
+ // Ignore unknown versions; it's probably a devel version.
+ return nil
+ }
+ if minor < 10 {
+ return errors.New("Go 1.10 or newer is required")
}
return nil
}
@@ -191,7 +193,7 @@
$ go get golang.org/x/mobile/cmd/gomobile
$ gomobile init
-At least Go 1.7 is required.
+At least Go 1.10 is required.
For detailed instructions, see https://golang.org/wiki/Mobile.
Usage: