Using Files as a Flag in the Golang Command Line Interface (CLI)

Using Files as a Flag in the Golang Command Line Interface (CLI)

Introduction In this post, we will see how to use files as a flag in the Golang Command Line Interface (CLI). This is useful when you want to pass a file (not the file name, but an object of file type) as a flag to your CLI application. Use the file name as a flag is straightforward, you can use the flag.String or flag.StringVar function to get the file name and then do the necessary checks to validate if this exist, create it, clean it, etc....

April 7, 2024 · 6 min · 1147 words · Christian González Di Antonio
Building and Debugging a C Project in Visual Studio Code with a Makefile

Building and Debugging a C Project in Visual Studio Code with a Makefile

Introduction I have been using Visual Studio Code (vscode) for my C language projects until I’m re-learning this powerful programming language. One of the features that I like about vscode is the ability to build and debug C language projects using a Makefile. In this post, I will show you how to build and debug a C project in vscode using a Makefile. also, I built a GitHub repository template for this project called c-library-template, where you can use it to create a new C project with the following features:...

March 31, 2024 · 15 min · 3118 words · Christian González Di Antonio