MCPcopy Create free account
hub / github.com/prometheus/procfs / mountOptionsParser

Function mountOptionsParser

mountinfo.go:148–161  ·  view source on GitHub ↗

mountOptionsParser parses the mount options, superblock options.

(mountOptions string)

Source from the content-addressed store, hash-verified

146
147// mountOptionsParser parses the mount options, superblock options.
148func mountOptionsParser(mountOptions string) map[string]string {
149 opts := make(map[string]string)
150 for opt := range strings.SplitSeq(mountOptions, ",") {
151 splitOption := strings.Split(opt, "=")
152 if len(splitOption) < 2 {
153 key := splitOption[0]
154 opts[key] = ""
155 } else {
156 key, value := splitOption[0], splitOption[1]
157 opts[key] = value
158 }
159 }
160 return opts
161}
162
163// readMountInfo reads a full mountinfo file (no 1 MiB cap, unlike parsers.ReadFileNoStat).
164func readMountInfo(path string) ([]byte, error) {

Callers 1

parseMountInfoStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected