Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppleCodename ¶
AppleCodename returns a codename, or an empty string. Will first use the lookup table, and then try to fetch it from Apple over HTTP.
Types ¶
type Distro ¶
type Distro struct {
// contains filtered or unexported fields
}
Distro represents the platform, contents of /etc/*release* and name of the detected Linux distribution or BSD.
func New ¶
func New() *Distro
New detects the platform and distro/BSD, then returns a pointer to a Distro struct.
func (*Distro) Codename ¶
Codename returns the detected codename of the current distro/BSD, or an empty string.
func (*Distro) EtcRelease ¶
EtcRelease returns the contents of /etc/*release + /etc/issue, or an empty string. The contents are cached.
func (*Distro) Grep ¶
Grep /etc/*release* for the given string. If the search fails, a case-insensitive string search is attempted. The contents of /etc/*release* is cached.
func (*Distro) Platform ¶
Platform returns the name of the current platform. This is the same as `runtime.GOOS`, but capitalized.