Word count CLI in Go

Motivation
https://codingchallenges.fyi/challenges/challenge-wc
Commands
Development
$ make test
$ make build
$ make clean
Usage
Directly usage
After building the tool successfully, there will be the executable file ccwc in the root folder.
$ ./ccwc -c test.txt
342190 test.txt
$ ./ccwc -l test.txt
7145 test.txt
$ ./ccwc -w test.txt
58164 test.txt
$ ./ccwc -m test.txt
339292 test.txt
$ ./ccwc test.txt
7145 58164 342190 test.txt
$ cat test.txt | ./ccwc -c
342190 test.txt
$ cat test.txt | ./ccwc -l
7145 test.txt
$ cat test.txt | ./ccwc -w
58164 test.txt
$ cat test.txt | ./ccwc -m
339292 test.txt
$ cat test.txt | ./ccwc
7145 58164 342190 test.txt
Testing
ccwc is a tool that tries to clone features from the Unix command wc. Thus, the unit tests will use the output from wc as the source of truth. Moreover, the outcome of count words method could be different on different environments.
License
MIT
Copyright (c) 2024-present, Tuan LE CONG