...

/

Refactoring Multi-git to use Cobra - The Plan

Refactoring Multi-git to use Cobra - The Plan

In this lesson. you'll apply what you learned about Cobra and how to adapt programs to use Cobra as a library.

We will go back to the multi-git program and refactor it to use Cobra. We already did a lot of the groundwork by organizing the directory structure of multi-git and breaking its functionality between a package and a command. Now, we will complete the process by incorporating Cobra, starting with a plan for the refactoring process.

Refactoring plan

The first step is to understand what is the current state of multi-git is and what the desired state is. Let’s review the current state quickly, describe clearly what the desired state is, and then come up with a concrete plan on how to go about it.

The current state of multi-git

The current version of multi-git is 0.4: ...