๐Ÿ”

Grep in Go

Exercise: Solve this exercise in Go with test cases.
๐Ÿ”
Grep exercise
Labels: Intermediate
Time to complete: 4-5 days
What will you learn:
  • Basics of CLI building in Go, parsing CLI flags, cobra library
  • File reading and writing, dealing with a large number of files
  • Writing table-driven tests
  • Power of interfaces in Go (io.Reader interface)
  • Using channels and goroutines to efficiently process multiple files in parallel, mutex, fan-in pattern for goroutines and channels.
How to evaluate your solution:
Actual Solution:
  • Donโ€™t look at the solution unless you have you. Otherwise, youโ€™re not getting much value from the bootcamp.
I know what I am doing; stop patronizing me.
Resources:
  • โ–ถ๏ธ Building Grep using Test driven development in Go on One2N YouTube channel (itโ€™s a long playlist, watch at 2x speed). This playlist contains a live code walkthrough where we build Grep in Go using Test Driven Development. https://www.youtube.com/playlist?list=PLMrAF6rR54XoimthOUqXkPXlIAVuE4N0i. If you find the videos too long and prefer a text version summary, see below:
โ–ถ๏ธ
Grep YouTube Playlist notes
ย