From 911bac5345502d099e93aa72a79b91e9ba14f01f Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 3 Aug 2024 14:11:18 +0300 Subject: adding Cmd to all functions returning a tea.Cmd --- internal/client/tui/submit.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'internal/client/tui/submit.go') diff --git a/internal/client/tui/submit.go b/internal/client/tui/submit.go index 3ab4ab5..d0b4c78 100644 --- a/internal/client/tui/submit.go +++ b/internal/client/tui/submit.go @@ -14,22 +14,22 @@ import ( tea "github.com/charmbracelet/bubbletea" ) -func submitAction(ctx context.Context, conf config.ClientConfig) tea.Cmd { +func submitActionCmd(ctx context.Context, conf config.ClientConfig) tea.Cmd { composeFile := fmt.Sprintf("%s/%s", conf.DataDir, conf.ComposeFile) log.Println("Submitting", composeFile) - return submitEntry(ctx, conf, composeFile, func() error { + return submitEntryCmd(ctx, conf, composeFile, func() error { // This is the cb to call when the entry was submitted succesfully return nil }) } -func submitEntry(ctx context.Context, conf client.ClientConfig, composeFile string, cb func() error) tea.Cmd { - return finished(cb, submitEntryNoCmd(ctx, conf, composeFile)) +func submitEntryCmd(ctx context.Context, conf client.ClientConfig, composeFile string, cb func() error) tea.Cmd { + return finished(cb, submitEntry(ctx, conf, composeFile)) } // TODO: Rename all functions returning a Cmd so that they have a Cmd suffix -func submitEntryNoCmd(ctx context.Context, conf client.ClientConfig, composeFile string) error { +func submitEntry(ctx context.Context, conf client.ClientConfig, composeFile string) error { servers, err := conf.Servers() if err != nil { return err -- cgit v1.2.3