blob: 96f36d28b52f084662b0bb7ea9abf78e177c13aa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
// +build js
package os
import (
"errors"
"github.com/gopherjs/gopherjs/js"
)
func runtime_args() []string { // not called on Windows
return Args
}
func init() {
if process := js.Global.Get("process"); process != js.Undefined {
argv := process.Get("argv")
Args = make([]string, argv.Length()-1)
for i := 0; i < argv.Length()-1; i++ {
Args[i] = argv.Index(i + 1).String()
}
}
if len(Args) == 0 {
Args = []string{"?"}
}
}
func runtime_beforeExit() {}
func executable() (string, error) {
return "", errors.New("Executable not implemented for GOARCH=js")
}
|