Discover Packages
gitlab.com/yarbelk/slimbox
lib
wc
package
Version:
v0.0.0-...-46b2b5f
Opens a new window with list of versions in this module.
Published: Jun 26, 2021
License: GPL-2.0
Opens a new window with license information.
Imports: 10
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
View Source
const (
LineFlag = "lines"
ByteFlag = "bytes"
WordFlag = "words"
CharFlag = "chars"
LongFlag = "max-line-length"
)
Main is the kickoff for the wc program. so it can be compiled stand alone or as a subcommand
runs as many workers as CPUs. this probably should be tunable at compile time
ReadFile from a chan and stream out results.
It was a closure over what the arguments are, but I want to pull it out to test
type Options struct {
Bytes, Characters, Newlines, Words, Longest bool
NFlag uint
Files []string
}
type Results struct {
Bytes, Characters, Newlines, Words, Longest uint
Filename string
}
Results are the totals for output
GetMax number (that isn't line) from this resultset for use in max line length parameter
type ResultsSet struct {
MaxNumber uint
Results []Results
}
Printf prints all results based on format options
Source Files
¶
Click to show internal directories.
Click to hide internal directories.