Help us shape the future of Go! Take the 2026 Go Developer Survey

elevate

package
v0.5.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package elevate makes a command that needs root or admin work without the user typing sudo or opening an elevated shell first.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Is

func Is() bool

Is says whether this process is root.

func Root

func Root(args ...string)

Root returns when this process is root or admin. Otherwise it runs this binary with args elevated and exits as that does.

func Run

func Run(args ...string) int

Run runs this binary with args under sudo, which asks for the password in this terminal, and returns its exit code. A sudo that never ran is 1, and returns, so the caller's cleanup runs.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL