TinyGo doesn't currently support Android directly. However, GOOS=linux
works fine on Android. Therefore, force GOOS=linux on Android.
Этот коммит содержится в:
Ayke van Laethem 2022-08-12 14:39:43 +02:00 коммит произвёл Ron Evans
родитель e70dfa4dd6
коммит a0407be7b7

Просмотреть файл

@ -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