cmd/gogio: fix argv passing from URL search fragment to Go program

Fixes the examples on gioui.org/doc/architecture.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-02-01 16:50:40 +01:00
parent e0033ce871
commit d420654dbc
+1 -1
View File
@@ -144,7 +144,7 @@ const (
// jsStartGo initializes the main.wasm.
jsStartGo = `(() => {
defaultGo = new Go();
Object.assign(defaultGo["argv"], go["argv"]);
Object.assign(defaultGo["argv"], defaultGo["argv"].concat(go["argv"]));
Object.assign(defaultGo["env"], go["env"]);
for (let key in go["importObject"]) {
if (typeof defaultGo["importObject"][key] === "undefined") {