Documentation ¶
Overview ¶
osrelease is a go package to make reading the contents of os-release files easier
See https://www.freedesktop.org/software/systemd/man/os-release.html
Index ¶
Examples ¶
Constants ¶
View Source
const EtcOsRelease string = "/etc/os-release"
View Source
const UsrLibOsRelease string = "/usr/lib/os-release"
Variables ¶
This section is empty.
Functions ¶
func Read ¶
Read and return os-release, trying EtcOsRelease, followed by UsrLibOsRelease. err will contain an error message if neither file exists or failed to parse
Example ¶
osrelease, err := Read() if err != nil { fmt.Printf("Error: %v\n", err) return } fmt.Printf("PRETTY_NAME = %v\n", osrelease["PRETTY_NAME"])
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.