This code is in proc.go. I can not understand function runtime_args, can anyone help me? Sorry for my poor english.
// Args hold the command-line arguments, starting with the program name.
var Args []string
func init() {
if runtime.GOOS == "windows" {
// Initialized in exec_windows.go.
return
}
Args = runtime_args()
}
func runtime_args() []string // in package runtime
// Getuid returns the numeric user id of the caller.
//
// On Windows, it returns -1.
func Getuid() int { return syscall.Getuid() }
According to Go Programming Language Specification
:
A function declaration may omit the body. Such a declaration provides the signature for a function implemented outside Go, such as an assembly routine.
In your case this function implementation is actually declared in the runtime
package
...
func runtime_args() []string // in package runtime
...
...
//go:linkname os_runtime_args os.runtime_args
func os_runtime_args() []string { return append([]string{}, argslice...) }
...