Company
Date Published
Author
Adam Gordon Bell
Word count
2506
Language
English
Hacker News points
None

Summary

The article details a software developer's journey in building an activity tracker using Golang, focusing on the implementation of command-line interface (CLI) flags. The developer explains the process of creating a CLI client for an existing REST service that records workout activities, utilizing Golang's flag package for parsing command-line arguments. The project involves developing functions for adding and retrieving activities, handling errors, and integrating a JSON client to communicate with the service. The author reflects on the challenges encountered, such as module naming inconsistencies and type mismatches, and makes necessary adjustments to improve the system. The article concludes with plans to enhance the tracker by incorporating gRPC for backend communication and adding persistence for data storage. Through this project, the developer aims to learn more about Golang and shares insights on using json.Marshal, error handling, and command-line parsing, while also highlighting the usefulness of Earthly for continuous integration testing.