Discover Packages
github.com/FollowTheProcess/gowc
internal
count
package
Version:
v0.4.0
Opens a new window with list of versions in this module.
Published: Jan 30, 2025
License: MIT
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package count implements the core counters used in gowc.
Write implements io.Writer for Bytes.
It doesn't actually write anything, but increments the byte count
on every byte in data, allowing a Bytes to be used as dst
in a call to io.Copy .
Write implements io.Writer for Chars.
It doesn't actually write anything, but increments the char count
on every utf8 rune in data, allowing a Chars to be used as dst
in a call to io.Copy .
Write implements io.Writer for Lines.
It doesn't actually write anything, but increments the line count
on every newline in data, allowing a Lines to be used as dst
in a call to io.Copy .
type Result struct {
Err error `json:"-"`
Name string `json:"name"`
Lines Lines `json:"lines"`
Bytes Bytes `json:"bytes"`
Words Words `json:"words"`
Chars Chars `json:"chars"`
}
Result encodes the result of a counting operation on a file.
One performs a counting operation on a single reader, returning the result and any error.
Display outputs the Count as a pretty table to w.
Results encodes multiple Results from different files.
All performs counting operations on multiple files concurrently
gathering up the results and returning.
Display outputs the Results to w.
Write implements io.Writer for Words.
It doesn't actually write anything, but increments the word count
on every word in data, allowing a Words to be used as dst
in a call to io.Copy .
Source Files
¶
Click to show internal directories.
Click to hide internal directories.