os
Description
Operating System information
Fields
ID | TYPE | DESCRIPTION |
---|---|---|
name | string | Pretty Hostname on Linux / Device name on Windows |
env | map[string]string | ENV variable contents |
path | []string | PATH variable contents |
uptime | time | Current uptime |
updates | []os.update | List of available OS updates |
rebootpending | bool | Indicates if a reboot is pending |
hostname | string | Hostname for this OS |
machineid | string | Machine ID for this OS |
Examples
Show all environment variables
os.env;
Retrieve a single environment variable
os.env["windir"];