()
| 34 | } |
| 35 | |
| 36 | func osName() string { |
| 37 | file, err := os.Open("/etc/os-release") |
| 38 | if err != nil { |
| 39 | return "" |
| 40 | } |
| 41 | defer file.Close() |
| 42 | scanner := bufio.NewScanner(file) |
| 43 | for scanner.Scan() { |
| 44 | if strings.HasPrefix(scanner.Text(), "PRETTY_NAME=") { |
| 45 | return string(bytes.Trim(bytes.TrimSpace(scanner.Bytes()[12:]), "\"")) |
| 46 | } |
| 47 | } |
| 48 | return "" |
| 49 | } |