func ReadOSRelease(f string) (map[string]string, error) {
	contents, err := ioutil.ReadFile(f)
	if err != nil {
		return nil, err
	}
	values := make(map[string]string)
	releaseDetails := strings.Split(string(contents), "\n")
	for _, val := range releaseDetails {
		c := strings.SplitN(val, "=", 2)
		if len(c) != 2 {
			continue
		}
		values[c[0]] = strings.Trim(c[1], "\t '\"")
	}
	if _, ok := values["ID"]; !ok {
		return nil, errors.New("OS release file is missing ID")
	}
	return values, nil
}
// ReadOSRelease parses the information in the os-release file.
//
// See http://www.freedesktop.org/software/systemd/man/os-release.html.
ReadOSRelease parses the information in the os-release file.


// ReadOSRelease parses the information in the os - release file . // // See http : // www . freedesktop . org / software / systemd / man / os - release . html .
func ReadOSRelease(f string) (map[string]string, error) {
	contents, err := ioutil.ReadFile(f)
	if err != nil {
		return nil, err
	}
	values := make(map[string]string)
	releaseDetails := strings.Split(string(contents), "\n")
	for _, val := range releaseDetails {
		c := strings.SplitN(val, "=", 2)
		if len(c) != 2 {
			continue
		}
		values[c[0]] = strings.Trim(c[1], "\t '\"")
	}
	if _, ok := values["ID"]; !ok {
		return nil, errors.New("OS release file is missing ID")
	}
	return values, nil
}
func ReadOSRelease ( f string ) ( map [ string ] string , error ) { contents , err := ioutil . ReadFile ( f ) if err != nil { return nil , err } values := make ( map [ string ] string ) releaseDetails := strings . Split ( string ( contents ) , " \n " ) for _ , val := range releaseDetails { c := strings . SplitN ( val , " " , 2 ) if len ( c ) != 2 { continue } values [ c [ 0 ] ] = strings . Trim ( c [ 1 ] , " \t \" " ) } if _ , ok := values [ " " ] ; ! ok { return nil , errors . New ( " " ) } return values , nil }
ReadOSRelease parses the information in the os-release file.
ReadOSRelease parses the information in the os - release file .