Skip to content

Commit 733f1ca

Browse files
.golangci.yml: Enable goconst and fix issues (#7)
1 parent cc64141 commit 733f1ca

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ linters:
1111
- ineffassign
1212
- deadcode
1313
- typecheck
14+
- goconst
1415

1516
run:
1617
deadline: 5m

pkg/client/actionclient_test.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ import (
4747
"github.com/joelanford/helm-operator/pkg/internal/testutil"
4848
)
4949

50+
const mockTestDesc = "Test Description"
51+
5052
var _ = Describe("ActionClient", func() {
5153
var (
5254
rm meta.RESTMapper
@@ -134,7 +136,7 @@ var _ = Describe("ActionClient", func() {
134136
err error
135137
)
136138
By("installing the release", func() {
137-
opt := func(i *action.Install) error { i.Description = "Test Description"; return nil }
139+
opt := func(i *action.Install) error { i.Description = mockTestDesc; return nil }
138140
rel, err = ac.Install(obj.GetName(), obj.GetNamespace(), &chrt, vals, opt)
139141
Expect(err).To(BeNil())
140142
Expect(rel).NotTo(BeNil())
@@ -182,7 +184,7 @@ var _ = Describe("ActionClient", func() {
182184
)
183185
BeforeEach(func() {
184186
var err error
185-
opt := func(i *action.Install) error { i.Description = "Test Description"; return nil }
187+
opt := func(i *action.Install) error { i.Description = mockTestDesc; return nil }
186188
installedRelease, err = ac.Install(obj.GetName(), obj.GetNamespace(), &chrt, vals, opt)
187189
Expect(err).To(BeNil())
188190
Expect(installedRelease).NotTo(BeNil())
@@ -246,7 +248,7 @@ var _ = Describe("ActionClient", func() {
246248
err error
247249
)
248250
By("upgrading the release", func() {
249-
opt := func(u *action.Upgrade) error { u.Description = "Test Description"; return nil }
251+
opt := func(u *action.Upgrade) error { u.Description = mockTestDesc; return nil }
250252
rel, err = ac.Upgrade(obj.GetName(), obj.GetNamespace(), &chrt, vals, opt)
251253
Expect(err).To(BeNil())
252254
Expect(rel).NotTo(BeNil())
@@ -281,7 +283,7 @@ var _ = Describe("ActionClient", func() {
281283
err error
282284
)
283285
By("uninstalling the release", func() {
284-
opt := func(i *action.Uninstall) error { i.Description = "Test Description"; return nil }
286+
opt := func(i *action.Uninstall) error { i.Description = mockTestDesc; return nil }
285287
resp, err = ac.Uninstall(obj.GetName(), opt)
286288
Expect(err).To(BeNil())
287289
Expect(resp).NotTo(BeNil())
@@ -568,7 +570,7 @@ func verifyRelease(cl client.Client, ns string, rel *release.Release) {
568570
})
569571

570572
By("verifying release status description option was honored", func() {
571-
Expect(rel.Info.Description).To(Equal("Test Description"))
573+
Expect(rel.Info.Description).To(Equal(mockTestDesc))
572574
})
573575

574576
By("verifying the release resources exist", func() {
@@ -592,7 +594,7 @@ func verifyNoRelease(cl client.Client, ns string, name string, rel *release.Rele
592594
})
593595
By("verifying the uninstall description option was honored", func() {
594596
if rel != nil {
595-
Expect(rel.Info.Description).To(Equal("Test Description"))
597+
Expect(rel.Info.Description).To(Equal(mockTestDesc))
596598
}
597599
})
598600
By("verifying all release resources are removed", func() {

0 commit comments

Comments
 (0)