Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultProcPath = "/proc"
DefaultProcPath is the default path to the /proc directory. It is used internally for testing and can be changed to the "testdata" directory for testing purposes.
Functions ¶
This section is empty.
Types ¶
type ProcFile ¶
type ProcFile struct { File fs.File // File handle Scanner *bufio.Scanner // Scanner for reading the file }
ProcFile represents a proc file, including its file handle and scanner for reading.
func NewProcFile ¶
NewProcFile creates a new ProcFile instance by opening the specified proc file path. It opens the file, creates a bufio.Scanner to read it, and returns the ProcFile instance. If any errors occur during file opening or scanner creation, it returns an error.
func (*ProcFile) SplitWords ¶
func (pf *ProcFile) SplitWords()
SplitWords configures the scanner to split words using bufio.ScanWords.
Click to show internal directories.
Click to hide internal directories.