Skip to content

Commit 72eb7e1

Browse files
committed
fix: fix golangci-lint errors
1 parent 15e167f commit 72eb7e1

File tree

5 files changed

+18
-14
lines changed

5 files changed

+18
-14
lines changed

pkg/env/env.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ func (e *testEnv) processTestFeature(ctx context.Context, t *testing.T, featureN
226226
t.Helper()
227227
skipped, message := e.requireFeatureProcessing(feature)
228228
if skipped {
229-
t.Skipf(message)
229+
t.Skip(message)
230230
}
231231
// execute beforeEachFeature actions
232232
ctx = e.processFeatureActions(ctx, t, feature, e.getBeforeFeatureActions())
@@ -510,7 +510,7 @@ func (e *testEnv) execFeature(ctx context.Context, t *testing.T, featName string
510510
internalT.Helper()
511511
skipped, message := e.requireAssessmentProcessing(assess, i+1)
512512
if skipped {
513-
internalT.Skipf(message)
513+
internalT.Skip(message)
514514
}
515515
// Set shouldFailNow to true before actually running the assessment, because if the assessment
516516
// calls t.FailNow(), the function will be abruptly stopped in the middle of `e.executeSteps()`.

third_party/flux/flux_setup.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package flux
1818

1919
import (
2020
"context"
21+
"errors"
2122
"fmt"
2223

2324
"sigs.k8s.io/e2e-framework/pkg/env"
@@ -44,7 +45,7 @@ func InstallFlux(opts ...Option) env.Func {
4445
func CreateGitRepo(gitRepoName, gitRepoURL string, opts ...Option) env.Func {
4546
return func(ctx context.Context, c *envconf.Config) (context.Context, error) {
4647
if manager == nil {
47-
return ctx, fmt.Errorf(NoFluxInstallationFoundMsg)
48+
return ctx, errors.New(NoFluxInstallationFoundMsg)
4849
}
4950
err := manager.createSource(Git, gitRepoName, gitRepoURL, opts...)
5051
if err != nil {
@@ -58,7 +59,7 @@ func CreateGitRepo(gitRepoName, gitRepoURL string, opts ...Option) env.Func {
5859
func CreateHelmRepository(name, url string, opts ...Option) env.Func {
5960
return func(ctx context.Context, c *envconf.Config) (context.Context, error) {
6061
if manager == nil {
61-
return ctx, fmt.Errorf(NoFluxInstallationFoundMsg)
62+
return ctx, errors.New(NoFluxInstallationFoundMsg)
6263
}
6364
err := manager.createSource(Helm, name, url, opts...)
6465
if err != nil {
@@ -72,7 +73,7 @@ func CreateHelmRepository(name, url string, opts ...Option) env.Func {
7273
func CreateKustomization(kustomizationName, sourceRef string, opts ...Option) env.Func {
7374
return func(ctx context.Context, c *envconf.Config) (context.Context, error) {
7475
if manager == nil {
75-
return ctx, fmt.Errorf(NoFluxInstallationFoundMsg)
76+
return ctx, errors.New(NoFluxInstallationFoundMsg)
7677
}
7778
err := manager.createKustomization(kustomizationName, sourceRef, opts...)
7879
if err != nil {
@@ -87,7 +88,7 @@ func CreateKustomization(kustomizationName, sourceRef string, opts ...Option) en
8788
func CreateHelmRelease(name, source, chart string, opts ...Option) env.Func {
8889
return func(ctx context.Context, c *envconf.Config) (context.Context, error) {
8990
if manager == nil {
90-
return ctx, fmt.Errorf(NoFluxInstallationFoundMsg)
91+
return ctx, errors.New(NoFluxInstallationFoundMsg)
9192
}
9293
err := manager.createHelmRelease(name, source, chart, opts...)
9394
if err != nil {
@@ -101,7 +102,7 @@ func CreateHelmRelease(name, source, chart string, opts ...Option) env.Func {
101102
func UninstallFlux(opts ...Option) env.Func {
102103
return func(ctx context.Context, c *envconf.Config) (context.Context, error) {
103104
if manager == nil {
104-
return ctx, fmt.Errorf(NoFluxInstallationFoundMsg)
105+
return ctx, errors.New(NoFluxInstallationFoundMsg)
105106
}
106107
err := manager.uninstallFlux(opts...)
107108
if err != nil {
@@ -115,7 +116,7 @@ func UninstallFlux(opts ...Option) env.Func {
115116
func DeleteKustomization(kustomizationName string, opts ...Option) env.Func {
116117
return func(ctx context.Context, c *envconf.Config) (context.Context, error) {
117118
if manager == nil {
118-
return ctx, fmt.Errorf(NoFluxInstallationFoundMsg)
119+
return ctx, errors.New(NoFluxInstallationFoundMsg)
119120
}
120121
err := manager.deleteKustomization(kustomizationName, opts...)
121122
if err != nil {
@@ -129,7 +130,7 @@ func DeleteKustomization(kustomizationName string, opts ...Option) env.Func {
129130
func DeleteHelmRelease(name string, opts ...Option) env.Func {
130131
return func(ctx context.Context, c *envconf.Config) (context.Context, error) {
131132
if manager == nil {
132-
return ctx, fmt.Errorf(NoFluxInstallationFoundMsg)
133+
return ctx, errors.New(NoFluxInstallationFoundMsg)
133134
}
134135
err := manager.deleteHelmRelease(name, opts...)
135136
if err != nil {
@@ -143,7 +144,7 @@ func DeleteHelmRelease(name string, opts ...Option) env.Func {
143144
func DeleteGitRepo(gitRepoName string, opts ...Option) env.Func {
144145
return func(ctx context.Context, c *envconf.Config) (context.Context, error) {
145146
if manager == nil {
146-
return ctx, fmt.Errorf(NoFluxInstallationFoundMsg)
147+
return ctx, errors.New(NoFluxInstallationFoundMsg)
147148
}
148149
err := manager.deleteSource(Git, gitRepoName, opts...)
149150
if err != nil {
@@ -157,7 +158,7 @@ func DeleteGitRepo(gitRepoName string, opts ...Option) env.Func {
157158
func DeleteHelmRepo(name string, opts ...Option) env.Func {
158159
return func(ctx context.Context, c *envconf.Config) (context.Context, error) {
159160
if manager == nil {
160-
return ctx, fmt.Errorf(NoFluxInstallationFoundMsg)
161+
return ctx, errors.New(NoFluxInstallationFoundMsg)
161162
}
162163
err := manager.deleteSource(Helm, name, opts...)
163164
if err != nil {

third_party/helm/helm.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package helm
1818

1919
import (
2020
"bytes"
21+
"errors"
2122
"fmt"
2223
"strings"
2324

@@ -237,7 +238,7 @@ func (m *Manager) run(opts *Opts) (err error) {
237238
}
238239
log.V(4).InfoS("Determining if helm binary is available or not", "executable", m.path)
239240
if m.e.Prog().Avail(m.path) == "" {
240-
err = fmt.Errorf(missingHelm)
241+
err = errors.New(missingHelm)
241242
return
242243
}
243244
command, err := m.getCommand(opts)

third_party/ko/ko.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package ko
1919
import (
2020
"bytes"
2121
"context"
22+
"errors"
2223
"fmt"
2324
"strings"
2425

@@ -159,7 +160,7 @@ func (m *Manager) GetLocalImage(ctx context.Context, packagePath string) (string
159160
func (m *Manager) run(opts *Opts) (out string, err error) {
160161
log.V(4).InfoS("Determining if ko binary is available or not", "executable", m.path)
161162
if m.e.Prog().Avail(m.path) == "" {
162-
return "", fmt.Errorf(missingKo)
163+
return "", errors.New(missingKo)
163164
}
164165

165166
envs := m.getEnvs(opts)

third_party/kubetest2/pkg/tester/e2e-tester_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ limitations under the License.
1717
package tester
1818

1919
import (
20-
"github.com/octago/sflags/gen/gpflag"
2120
"testing"
21+
22+
"github.com/octago/sflags/gen/gpflag"
2223
)
2324

2425
func TestBuildFlags(t *testing.T) {

0 commit comments

Comments
 (0)