wc
command in Unix systems, implemented in Go.
make build
→ creates thego-wc
executablesudo ln -s "$PWD/go-wc" /usr/local/bin/go-wc
→ creates a symbolic link to thego-wc
executable in$PATH
so we don't have to use the./
prefix everytime we run the app.go-wc [-c | -l | -w] <file-name>
orcat <file-name> | go-wc [-c | -l | -w]
or simplygo-wc [-c | -l | -w]
and you can type directly to the terminal, and the app will start counting words.- Optional flags:
-c
→ Prints bytes in the given stream-l
→ Prints lines in the given stream-w
→ Prints words in the given stream