...

/

Solution 1: Go Concurrency

Solution 1: Go Concurrency

Let’s solve the challenge set in the previous lesson.

We'll cover the following...

Solution

Here’s the concurrent version of wc(1) that uses a buffered channel.

Dimitris, Tsoukalos, 2101112223, 1600665563
Mihalis, Tsoukalos, 2109416471, 1600665563
Jane, Doe, 0800123456, 1608559903
wc.go

Code explanation

The above code is an implementation of the wc command-line utility in the Go language. The wc command is used to count the number of lines, words, and characters in a file. The program accepts one or more file names as input and counts the number of characters, words, lines, and bytes for each file. Finally, it prints the total count for all the files.

Here is a step-by-step ...