diff --git a/.golangci.yaml b/.golangci.yaml index 156d664989..15c381a682 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -2,6 +2,10 @@ # Over time we should try tightening some of these. linters-settings: + dupl: + # goal: 100 + threshold: 412 + exhaustruct: include: # Gradually extend to cover more of the codebase. @@ -268,3 +272,4 @@ linters: - typecheck - unconvert - unused + - dupl diff --git a/cli/update_test.go b/cli/update_test.go index 0efa1f997c..38b042d281 100644 --- a/cli/update_test.go +++ b/cli/update_test.go @@ -602,13 +602,9 @@ func TestUpdateValidateRichParameters(t *testing.T) { // Update the workspace inv, root = clitest.New(t, "update", "my-workspace") clitest.SetupConfig(t, client, root) - doneChan := make(chan struct{}) + pty := ptytest.New(t).Attach(inv) - go func() { - defer close(doneChan) - err := inv.Run() - assert.NoError(t, err) - }() + clitest.Start(t, inv) matches := []string{ stringParameterName, "second_option", @@ -623,7 +619,6 @@ func TestUpdateValidateRichParameters(t *testing.T) { pty.WriteLine(value) } } - <-doneChan }) t.Run("ParameterOptionDisappeared", func(t *testing.T) { @@ -668,13 +663,8 @@ func TestUpdateValidateRichParameters(t *testing.T) { // Update the workspace inv, root = clitest.New(t, "update", "my-workspace") clitest.SetupConfig(t, client, root) - doneChan := make(chan struct{}) pty := ptytest.New(t).Attach(inv) - go func() { - defer close(doneChan) - err := inv.Run() - assert.NoError(t, err) - }() + clitest.Start(t, inv) matches := []string{ stringParameterName, "Third option", @@ -689,7 +679,6 @@ func TestUpdateValidateRichParameters(t *testing.T) { pty.WriteLine(value) } } - <-doneChan }) t.Run("ImmutableRequiredParameterExists_MutableRequiredParameterAdded", func(t *testing.T) {