Set file permissions precisely
syscall.Umask(0o077) // affects os.Create / OpenFile defaults
syscallLow-level, platform-specific OS primitives. Frozen — prefer os, os/exec, and golang.org/x/sys for anything new.
syscall.Umask(0o077) // affects os.Create / OpenFile defaults
cmd := exec.Command("srv")
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
cmd.Start()
syscall.Kill(pid, syscall.SIGTERM)
_, err := os.Open("x")
if errors.Is(err, syscall.ENOENT) { /* missing file */ }
New OS features land in golang.org/x/sys, not here. Use this package only when you can't avoid it.