gwc
is a simple implementation of the Unix wc
(word count) tool written in Go. This project is a learning exercise inspired by Coding Challenges, aiming to deepen understanding of Go and Unix-like command-line utilities.
- Count lines, words, and bytes in files or standard input.
- Mimics basic functionality of the classic
wc
command.
./gwc [options] [file...]
-l
: Count lines.-w
: Count words.-c
: Count bytes.-m
: Count characters.
./gwc file.txt
./gwc -l file.txt
./gwc -w file1.txt file2.txt
./gwc -m file1.txt file2.txt
echo "Hello, World!" | ./gwc
- Make sure you have Go installed on your system (version 1.20 or later).
- Clone the repository:
git clone https://github.com/flan6/gwc.git cd gwc
- Build the project:
go build -o gwc
Run tests using:
go test ./...
This project is a personal learning exercise, but feedback and suggestions are welcome! Feel free to open an issue or submit a pull request.
This project is licensed under the MIT License.
- Inspired by challenges from Coding Challenges.
- Special thanks to the Go community for their resources and tools.
This is a learning project and may not handle edge cases or performance optimizations as rigorously as the standard wc
tool.