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

Function firstNonEmptyLine

cpuinfo.go:510–518  ·  view source on GitHub ↗

firstNonEmptyLine advances the scanner to the first non-empty line and returns the contents of that line.

(scanner *bufio.Scanner)

Source from the content-addressed store, hash-verified

508// firstNonEmptyLine advances the scanner to the first non-empty line
509// and returns the contents of that line.
510func firstNonEmptyLine(scanner *bufio.Scanner) string {
511 for scanner.Scan() {
512 line := scanner.Text()
513 if strings.TrimSpace(line) != "" {
514 return line
515 }
516 }
517 return ""
518}

Callers 7

parseCPUInfoX86Function · 0.85
parseCPUInfoARMFunction · 0.85
parseCPUInfoS390XFunction · 0.85
parseCPUInfoMipsFunction · 0.85
parseCPUInfoLoongFunction · 0.85
parseCPUInfoPPCFunction · 0.85
parseCPUInfoRISCVFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected