MCPcopy
hub / github.com/nextdns/nextdns / osName

Function osName

host/model_linux.go:36–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34}
35
36func 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}

Callers 1

ModelFunction · 0.85

Calls 2

BytesMethod · 0.80
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…