Release 0.1? I feel I just released a final 1.0.0 and I am not being over confident…

Tony Vu
2 min readSep 24, 2020

--

The moment I pushed my final piece of modification to Github one day before the due date was when I finally can relax a bit. It has been an intensed working week that I started at 9am and only shut down my computer at 11pm. First couple weeks of school are always hard in term of adjusting your time to the new schedule and I spent a lot of time in open source development to create the demanded release 0.1.

So what’s inside release 0.1? Release 0.1 is supposed to be a CLI tool that users can use to check status of all URLs parsed from an input file. Sounds straightforward, right? “Just a CLI tool, it should be easy!” was my initial thought until I realized that there are many ways to create a CLI tool…BUT… in other languages rather than GO, the lovely language I decided to code with. At that moment, I knew I need to improvise. I read through most of the tutorial blogs I could find about GO CLI and spent decent amount of time looking at packages in GO document. For some days, that's what I did the whole day. Despite of being procrasted sometimes, hard works finally paid off. On Thursday, September 24th 2020, I proudly released my GO URLs CHECKER CLI (GUCC) v1.0.0.

One of the difficulties I have faced writing this program is to determine its scope. My bad habit is as I start adding more codes into my program, I also create more ideas and hence making my program too large and unorganized. I have tried to follow good practices and eliminate this habit. As a result, my final released version is modular and dry.

Anyway, I think I really need to start talking about my program rather than my struggling or professor Dave might be mad. So here we go! GUCC allows users to pass in a filename as command-line input. The program will then read the file and convert it into a big string. Then the parsing happens by using a very long regex to match all valid URLs.The URLs are subsequently put into a slice (GO name for list/array). Then the program simply loops through each link in the slice and makes a HEAD request to it. At this point, my program has already fulfilled the basic requirements of release 0.1. However, it was very slow because each link is checked synchronously. To increase the performance, I decided to implement Go routine, Go’s solution for concurrency. Now everytime a link is checked, an independent go routine will be created and that routine can wait for response while the main routine continue creating another routine for the next link. So how fast my program has become? It checked 769 links in ~2.5 seconds. Some “WOW” maybe?

More information about my program can be found here:
https://github.com/tonyvugithub/GoURLsCheckerCLI

I would welcome anyone to PR my repo or should I say “Contributors needed!”

Thank you for reading,

Tony.

--

--

No responses yet