Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Building Modern CLI Applications in Go
  • Table Of Contents Toc
Building Modern CLI Applications in Go

Building Modern CLI Applications in Go

By : Marian Montagnino
4.7 (14)
close
close
Building Modern CLI Applications in Go

Building Modern CLI Applications in Go

4.7 (14)
By: Marian Montagnino

Overview of this book

Although graphical user interfaces (GUIs) are intuitive and user-friendly, nothing beats a command-line interface (CLI) when it comes to productivity. Many organizations settle for a GUI without searching for alternatives that offer better accessibility and functionality. If this describes your organization, then pick up this book and get them to rethink that decision. Building Modern CLI Applications in Go will help you achieve an interface that rivals a GUI in elegance yet surpasses it in high-performance execution. Through its practical, step-by-step approach, you’ll learn everything you need to harness the power and simplicity of the Go language to build CLI applications that revolutionize the way you work. After a primer on CLI standards and Go, you’ll be launched into tool design and proper framework use for true development proficiency. The book then moves on to all things CLI, helping you master everything from arguments and flags to errors and API calls. Later, you’ll dive into the nuances of empathic development so that you can ensure the best UX possible, before you finish up with build tags, cross-compilation, and container-based distribution. By the end of this UX book, you’ll be fully equipped to take the performance and flexibility of your organization’s applications to the next level.
Table of Contents (21 chapters)
close
close
1
Part 1: Getting Started with a Solid Foundation
6
Part 2: The Ins and Outs of a CLI
10
Part 3: Interactivity and Empathic Driven Design
14
Part 4: Building and Distributing for Different Platforms

Processing data

Data processing is when raw data is fed into a process, analyzed, and then used to generate useful information or output. At a very general level, this can include sorting data, searching or querying for data, and converting data from one type of input into another. For a CLI, the input can be received in the different ways discussed in the previous section. When receiving arguments using the Cobra framework, all the values are read in as string input. However, given a string of 123, we can do a type check by utilizing the strconv package’s Atoi method, which converts an ASCII string into an integer:

val, err := strconv.Atoi("123")

If the string value cannot be converted because it isn’t a string representation of an integer, then an error will be thrown. If the string is a representation of an integer, then the integer value will be stored in the val variable.

The strconv package can be used to check, with conversion, many other types...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Building Modern CLI Applications in Go
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon