From 7b6712e05a9f110efab4f8d1ae64e0a776717e5c Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sun, 5 Oct 2025 01:01:38 +0100 Subject: [PATCH] Refactor Signed-off-by: Oliver Davies --- internal/cli/edit.go | 2 +- internal/cli/find.go | 4 ++-- internal/cli/links.go | 2 +- internal/cli/titles.go | 4 ++-- internal/cli/view.go | 2 +- internal/zet/zet.go | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/cli/edit.go b/internal/cli/edit.go index cb0ad66..6cb3814 100644 --- a/internal/cli/edit.go +++ b/internal/cli/edit.go @@ -52,7 +52,7 @@ zet edit|e latest os.Exit(0) } - zetList := zet.CreateZetList(ids) + zetList := zet.NewZetList(ids) zets := zetList.Parse() diff --git a/internal/cli/find.go b/internal/cli/find.go index e64561f..32cdacd 100644 --- a/internal/cli/find.go +++ b/internal/cli/find.go @@ -28,7 +28,7 @@ If -j or --json is added, the results will be in JSON format.`, zets := zet.SearchZets(args[0]) if jsonOutput { - zetList := zet.CreateZetList(zets, false) + zetList := zet.NewZetList(zets, false) result := zetList.Parse() @@ -40,7 +40,7 @@ If -j or --json is added, the results will be in JSON format.`, fmt.Println(json) } else { - zetList := zet.CreateZetList(zets) + zetList := zet.NewZetList(zets) result := zetList.Parse() diff --git a/internal/cli/links.go b/internal/cli/links.go index 9ed57f1..244f45d 100644 --- a/internal/cli/links.go +++ b/internal/cli/links.go @@ -23,7 +23,7 @@ var linksCmd = &cobra.Command{ zets := zet.SearchZets(args[0]) - zetList := zet.CreateZetList(zets) + zetList := zet.NewZetList(zets) lines := zetList.Parse() diff --git a/internal/cli/titles.go b/internal/cli/titles.go index 8ce0bd3..c117c1e 100644 --- a/internal/cli/titles.go +++ b/internal/cli/titles.go @@ -21,7 +21,7 @@ If -j or --json is added, the results will be in JSON format.`, zets := zet.GetAllZets() if jsonOutput { - zetList := zet.CreateZetList(zets, false) + zetList := zet.NewZetList(zets, false) result := zetList.Parse() @@ -33,7 +33,7 @@ If -j or --json is added, the results will be in JSON format.`, fmt.Println(json) } else { - zetList := zet.CreateZetList(zets) + zetList := zet.NewZetList(zets) result := zetList.Parse() diff --git a/internal/cli/view.go b/internal/cli/view.go index 0ac406a..6637bdc 100644 --- a/internal/cli/view.go +++ b/internal/cli/view.go @@ -52,7 +52,7 @@ zet view|v latest os.Exit(0) } - zetList := zet.CreateZetList(ids) + zetList := zet.NewZetList(ids) zets := zetList.Parse() diff --git a/internal/zet/zet.go b/internal/zet/zet.go index b18a30f..1426822 100644 --- a/internal/zet/zet.go +++ b/internal/zet/zet.go @@ -17,7 +17,7 @@ type ZetList struct { UseColors bool } -func CreateZetList(ids []int, useColors ...bool) *ZetList { +func NewZetList(ids []int, useColors ...bool) *ZetList { colorSetting := true if len(useColors) > 0 {