mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-19 03:54:01 +00:00
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:
committed by
Ron Evans
parent
e70dfa4dd6
commit
a0407be7b7
+7
-3
@@ -42,10 +42,14 @@ var TINYGOROOT string
|
|||||||
func Get(name string) string {
|
func Get(name string) string {
|
||||||
switch name {
|
switch name {
|
||||||
case "GOOS":
|
case "GOOS":
|
||||||
if dir := os.Getenv("GOOS"); dir != "" {
|
goos := os.Getenv("GOOS")
|
||||||
return dir
|
if goos == "" {
|
||||||
|
goos = runtime.GOOS
|
||||||
}
|
}
|
||||||
return runtime.GOOS
|
if goos == "android" {
|
||||||
|
goos = "linux"
|
||||||
|
}
|
||||||
|
return goos
|
||||||
case "GOARCH":
|
case "GOARCH":
|
||||||
if dir := os.Getenv("GOARCH"); dir != "" {
|
if dir := os.Getenv("GOARCH"); dir != "" {
|
||||||
return dir
|
return dir
|
||||||
|
|||||||
Reference in New Issue
Block a user