wcgo
is a Go-based minimal utility of the Unix wc
command. It provides functionality to count lines, words,
bytes, and characters in a given file. The project includes a Makefile for building and running the program easily.
-
Clone the repository:
cd wcgo
-
Ensure you have Go and Make installed:
go version make --version
Build the program using the provided Makefile:
make build
3 This will build the program for the target ARCH in the build directory.You can run the program with the desired options:
- To count lines, words, bytes, and characters in a file:
./build/wcgo <filename>
- To count lines:
./build/wcgo -l <filename>
- To count only words
./build/wcgo -w <filename>
- To count only bytes:
./build/wcgo -c <filename>
Challenge Source
This project was developed as a solution to a coding challenge from coding challenges