Golang processes: Difference between revisions
From wikinotes
Line 17: | Line 17: | ||
os.Getuid() | os.Getuid() | ||
os.Getgid() | os.Getgid() | ||
os.Getwd() // get current pwd/cwd | pwd, err := os.Getwd() // get current pwd/cwd | ||
os.Exit(0) | os.Exit(0) // exit process with exitcode '1' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</blockquote><!-- Current Process --> | </blockquote><!-- Current Process --> |
Revision as of 04:06, 18 June 2022
Documentation
os
https://pkg.go.dev/os@go1.18.3
Current Process
os.Executable() os.Getpid() os.Getppid() os.Getuid() os.Getgid() pwd, err := os.Getwd() // get current pwd/cwd os.Exit(0) // exit process with exitcode '1'
Manage Processes
os.Process.FindProcess() os.Process.Kill() os.Process.Signal()
Subprocess
os.Process.StartProcess ProcAttr Process