os: add Args and stub it with mock data
Этот коммит содержится в:
родитель
6b8940421e
коммит
e907db1481
2 изменённых файлов: 13 добавлений и 1 удалений
|
@ -9,6 +9,15 @@ import (
|
||||||
"syscall"
|
"syscall"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Args hold the command-line arguments, starting with the program name.
|
||||||
|
var Args []string
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
Args = runtime_args()
|
||||||
|
}
|
||||||
|
|
||||||
|
func runtime_args() []string // in package runtime
|
||||||
|
|
||||||
// Exit causes the current program to exit with the given status code.
|
// Exit causes the current program to exit with the given status code.
|
||||||
// Conventionally, code zero indicates success, non-zero an error.
|
// Conventionally, code zero indicates success, non-zero an error.
|
||||||
// The program terminates immediately; deferred functions are not run.
|
// The program terminates immediately; deferred functions are not run.
|
||||||
|
|
|
@ -24,9 +24,12 @@ func GOROOT() string {
|
||||||
return "/usr/local/go"
|
return "/usr/local/go"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: fill with real args.
|
||||||
|
var args = []string{"/proc/self/exe"}
|
||||||
|
|
||||||
//go:linkname os_runtime_args os.runtime_args
|
//go:linkname os_runtime_args os.runtime_args
|
||||||
func os_runtime_args() []string {
|
func os_runtime_args() []string {
|
||||||
return nil
|
return args
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy size bytes from src to dst. The memory areas must not overlap.
|
// Copy size bytes from src to dst. The memory areas must not overlap.
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче