Search⌘ K
AI Features

Exercise: Capturing and Parsing Command Output

Explore how to enhance your Go command-line tool by adding functionality to execute an external command, capture its output, and parse the result to control process flow based on code complexity metrics. This lesson teaches you error handling, output processing, and command execution using Go's exec and strconv packages.

We'll cover the following...

Challenge

In this exercise, your challenge is to expand the goci tool that we developed previously to capture and parse the output of an additional command execution.

Problem Statement

Gocyclo is a tool that calculates relative complexity in Go functions. Functions that score higher might be good candidates for refactoring as ...