6
0
mirror of https://github.com/grdl/git-get.git synced 2026-02-10 15:29:19 +00:00

Cleanup the print package

- Use strings.Builder instead of concatenation
- Move smart tree to a separate file
- Add missing docstrings
This commit is contained in:
Grzegorz Dlugoszewski
2020-06-18 19:20:03 +02:00
parent 4fbdcde57b
commit 32211e6408
7 changed files with 119 additions and 106 deletions

View File

@@ -96,7 +96,7 @@ gitlab.com/
repos = append(repos, repo.New(nil, path)) //&Repo{path: path})
}
printer := SmartTreePrinter{}
printer := SmartPrinter{}
// Leading and trailing newlines are added to test cases for readability. We also need to add them to the rendering result.
got := fmt.Sprintf("\n%s\n", printer.Print("root", repos))