goenv: support GOOS=android

TinyGo doesn't currently support Android directly. However, GOOS=linux
works fine on Android. Therefore, force GOOS=linux on Android.
This commit is contained in:
Ayke van Laethem
2022-08-12 14:39:43 +02:00
committed by Ron Evans
parent e70dfa4dd6
commit a0407be7b7
+7 -3
View File
@@ -42,10 +42,14 @@ var TINYGOROOT string
func Get(name string) string {
switch name {
case "GOOS":
if dir := os.Getenv("GOOS"); dir != "" {
return dir
goos := os.Getenv("GOOS")
if goos == "" {
goos = runtime.GOOS
}
return runtime.GOOS
if goos == "android" {
goos = "linux"
}
return goos
case "GOARCH":
if dir := os.Getenv("GOARCH"); dir != "" {
return dir