You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
581 B
33 lines
581 B
// +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")
|
|
}
|