From 01daf66be249ecbeeff7db83b1f278e08f5edf70 Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Tue, 29 Dec 2020 12:15:46 -0500 Subject: [PATCH] golangci-lint fixes --- integration/base/integration_test.go | 2 +- integration/init/integration_test.go | 2 +- integration/init_app/integration_test.go | 2 +- integration/unfork/integration_test.go | 4 ++-- integration/update/integration_test.go | 2 +- pkg/helm/template.go | 2 +- pkg/lifecycle/daemon/routes_navcycle_getstep.go | 2 +- pkg/lifecycle/daemon/routes_navcycle_getstep_test.go | 2 +- pkg/lifecycle/daemon/routes_navcycle_kustomize_test.go | 4 ++-- pkg/lifecycle/render/helm/template.go | 2 +- pkg/ship/dig.go | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/integration/base/integration_test.go b/integration/base/integration_test.go index ba5b87128..b69e91b6b 100644 --- a/integration/base/integration_test.go +++ b/integration/base/integration_test.go @@ -41,7 +41,7 @@ func TestShipApp(t *testing.T) { } var _ = Describe("ship app", func() { - dockerClient, err := client.NewEnvClient() + dockerClient, err := client.NewClientWithOpts(client.FromEnv) if err != nil { panic(err) } diff --git a/integration/init/integration_test.go b/integration/init/integration_test.go index 81f3b2029..51245305e 100644 --- a/integration/init/integration_test.go +++ b/integration/init/integration_test.go @@ -38,7 +38,7 @@ func TestInit(t *testing.T) { } var _ = Describe("ship init with arbitrary upstream", func() { - dockerClient, err := client.NewEnvClient() + dockerClient, err := client.NewClientWithOpts(client.FromEnv) if err != nil { panic(err) } diff --git a/integration/init_app/integration_test.go b/integration/init_app/integration_test.go index e8cd934fb..d85bd0ca9 100644 --- a/integration/init_app/integration_test.go +++ b/integration/init_app/integration_test.go @@ -45,7 +45,7 @@ func TestInitReplicatedApp(t *testing.T) { } var _ = Describe("ship init replicated.app/...", func() { - dockerClient, err := client.NewEnvClient() + dockerClient, err := client.NewClientWithOpts(client.FromEnv) if err != nil { panic(err) } diff --git a/integration/unfork/integration_test.go b/integration/unfork/integration_test.go index 9a75da7eb..828aae520 100644 --- a/integration/unfork/integration_test.go +++ b/integration/unfork/integration_test.go @@ -36,7 +36,7 @@ func TestUnfork(t *testing.T) { } var _ = Describe("ship unfork", func() { - dockerClient, err := client.NewEnvClient() + dockerClient, err := client.NewClientWithOpts(client.FromEnv) if err != nil { panic(err) } @@ -111,7 +111,7 @@ var _ = Describe("ship unfork", func() { if testMetadata.IgnoredKeys == nil { testMetadata.IgnoredKeys = make(map[string][]string) } - if _, ok := testMetadata.IgnoredKeys[".ship/state.json"]; ok { + if _, ok := testMetadata.IgnoredKeys[".ship/state.json"]; ok { //nolint:gosimple testMetadata.IgnoredKeys[".ship/state.json"] = append(testMetadata.IgnoredKeys[".ship/state.json"], "v1.shipVersion") } else { testMetadata.IgnoredKeys[".ship/state.json"] = []string{"v1.shipVersion"} diff --git a/integration/update/integration_test.go b/integration/update/integration_test.go index 7a2b60fc0..959db4abc 100644 --- a/integration/update/integration_test.go +++ b/integration/update/integration_test.go @@ -35,7 +35,7 @@ func TestShipUpdate(t *testing.T) { } var _ = Describe("ship update", func() { - dockerClient, err := client.NewEnvClient() + dockerClient, err := client.NewClientWithOpts(client.FromEnv) if err != nil { panic(err) } diff --git a/pkg/helm/template.go b/pkg/helm/template.go index cdc20db8f..e9505c5ed 100644 --- a/pkg/helm/template.go +++ b/pkg/helm/template.go @@ -91,7 +91,7 @@ func newTemplateCmd(out io.Writer) *cobra.Command { cmd := &cobra.Command{ Use: "template [flags] CHART", - Short: fmt.Sprintf("locally render templates"), + Short: "locally render templates", Long: templateDesc, SilenceErrors: true, SilenceUsage: true, diff --git a/pkg/lifecycle/daemon/routes_navcycle_getstep.go b/pkg/lifecycle/daemon/routes_navcycle_getstep.go index f6d605f6d..06c18160a 100644 --- a/pkg/lifecycle/daemon/routes_navcycle_getstep.go +++ b/pkg/lifecycle/daemon/routes_navcycle_getstep.go @@ -195,7 +195,7 @@ func (d *NavcycleRoutes) getActions(step daemontypes.Step) []daemontypes.Action Text: "Saving", LoadingText: "Save", OnClick: daemontypes.ActionRequest{ - URI: fmt.Sprintf("/helm-values"), + URI: "/helm-values", Method: "POST", Body: "", }, diff --git a/pkg/lifecycle/daemon/routes_navcycle_getstep_test.go b/pkg/lifecycle/daemon/routes_navcycle_getstep_test.go index 5f550dde5..5b1f9132c 100644 --- a/pkg/lifecycle/daemon/routes_navcycle_getstep_test.go +++ b/pkg/lifecycle/daemon/routes_navcycle_getstep_test.go @@ -533,7 +533,7 @@ func TestHydrateStep(t *testing.T) { Text: "Saving", LoadingText: "Save", OnClick: daemontypes.ActionRequest{ - URI: fmt.Sprintf("/helm-values"), + URI: "/helm-values", Method: "POST", Body: "", }, diff --git a/pkg/lifecycle/daemon/routes_navcycle_kustomize_test.go b/pkg/lifecycle/daemon/routes_navcycle_kustomize_test.go index 8f6dd8521..8968aff81 100644 --- a/pkg/lifecycle/daemon/routes_navcycle_kustomize_test.go +++ b/pkg/lifecycle/daemon/routes_navcycle_kustomize_test.go @@ -159,7 +159,7 @@ func TestV2KustomizeSaveFile(t *testing.T) { } diff := deep.Equal(&test.ExpectState, c) if len(diff) != 0 { - fmt.Print(fmt.Sprintf("Failed diff compare with %s", strings.Join(diff, "\n"))) + fmt.Printf("Failed diff compare with %s", strings.Join(diff, "\n")) return false } return true @@ -281,7 +281,7 @@ func TestV2KustomizeDeleteFile(t *testing.T) { } diff := deep.Equal(&test.ExpectState, c) if len(diff) != 0 { - fmt.Print(fmt.Sprintf("Failed diff compare with %s", strings.Join(diff, "\n"))) + fmt.Printf("Failed diff compare with %s", strings.Join(diff, "\n")) return false } return true diff --git a/pkg/lifecycle/render/helm/template.go b/pkg/lifecycle/render/helm/template.go index f4075d32a..b25bbb4b3 100644 --- a/pkg/lifecycle/render/helm/template.go +++ b/pkg/lifecycle/render/helm/template.go @@ -562,7 +562,7 @@ func fixLines(lines []string) []string { // returns true if the second line is a child of the first func checkIsChild(firstLine, secondLine string) bool { - cutset := fmt.Sprintf(" \t") + cutset := " \t" firstIndentation := len(firstLine) - len(strings.TrimLeft(firstLine, cutset)) secondIndentation := len(secondLine) - len(strings.TrimLeft(secondLine, cutset)) diff --git a/pkg/ship/dig.go b/pkg/ship/dig.go index 07eb5c70c..bf42bc0b6 100644 --- a/pkg/ship/dig.go +++ b/pkg/ship/dig.go @@ -90,7 +90,7 @@ func buildInjector(v *viper.Viper) (*dig.Container, error) { docker.NewStep, - dockercli.NewEnvClient, + dockercli.NewEnvClient, //nolint dockerlayer.NewUnpacker, dockerlayer.TarArchiver,