Skip to content

Commit 336b9b3

Browse files
authored
tinygo: detect GOOS=wasip1 for relative WASI paths via config instead of target name (#4423)
1 parent ef4f46f commit 336b9b3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

main.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,13 +305,11 @@ func Test(pkgName string, stdout, stderr io.Writer, options *compileopts.Options
305305
//
306306
// Ex. run --dir=.. --dir=../.. --dir=../../..
307307
var dirs []string
308-
switch config.Options.Target {
308+
switch config.Target.GOOS {
309309
case "wasip1":
310310
dirs = dirsToModuleRootRel(result.MainDir, result.ModuleRoot)
311-
case "wasip2":
312-
dirs = dirsToModuleRootAbs(result.MainDir, result.ModuleRoot)
313311
default:
314-
return fmt.Errorf("unknown GOOS target: %v", config.Options.Target)
312+
dirs = dirsToModuleRootAbs(result.MainDir, result.ModuleRoot)
315313
}
316314

317315
args := []string{"run"}

0 commit comments

Comments
 (0)