From 56e55efac6f5e9561c198b1271243f77e4f45e33 Mon Sep 17 00:00:00 2001 From: Danny Olson Date: Wed, 3 Apr 2024 15:50:25 -0700 Subject: [PATCH] Set up iota to describe steps instead of using ints --- internal/quickstart/container.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/quickstart/container.go b/internal/quickstart/container.go index 753d3d72..65184a26 100644 --- a/internal/quickstart/container.go +++ b/internal/quickstart/container.go @@ -16,6 +16,14 @@ const ( defaultEnvKey = "test" ) +const ( + _ = iota + stepCreateFlag + stepChooseSDK + stepShowSDKInstructions + stepToggleFlag +) + // ContainerModel is a high level container model that controls the nested models wher each // represents a step in the quick-start flow. type ContainerModel struct { @@ -57,7 +65,7 @@ func (m ContainerModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { cmd = tea.Quit case key.Matches(msg, keys.Back): // if showing SDK instructions, let the user go back to choose a different SDK - if m.currentStep == 2 { + if m.currentStep == stepShowSDKInstructions { m.currentStep -= 1 m.currentModel = NewChooseSDKModel(m.sdk.index) cmd = m.currentModel.Init()