Skip to content

Commit d62140b

Browse files
committed
golanci-lint: drop unused nolint and some other fixes around that
1 parent acd2436 commit d62140b

File tree

15 files changed

+18
-21
lines changed

15 files changed

+18
-21
lines changed

errext/exitcodes/codes.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
// Package exitcodes contains the constants representing possible k6 exit error codes.
2-
//
3-
//nolint:golint
42
package exitcodes
53

64
// ExitCode is just a type representing a process exit code for k6

internal/cmd/cloud.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func (c *cmdCloud) run(cmd *cobra.Command, args []string) error {
118118
return err
119119
}
120120
if !cloudConfig.Token.Valid {
121-
return errors.New( //nolint:golint
121+
return errors.New(
122122
"not logged in, please login first to the Grafana Cloud k6 " +
123123
"using the \"k6 cloud login\" command",
124124
)
@@ -313,7 +313,6 @@ func (c *cmdCloud) run(cmd *cobra.Command, args []string) error {
313313
logger.WithField("run_status", testProgress.RunStatusText).Debug("Test finished")
314314
}
315315

316-
//nolint:stylecheck,golint
317316
if testProgress.ResultStatus == cloudapi.ResultStatusFailed {
318317
// Although by looking at [ResultStatus] and [RunStatus] isn't self-explanatory,
319318
// the scenario when the test run has finished, but it failed is an exceptional case for those situations

internal/js/eventloop/eventloop.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ func (e *EventLoop) Start(firstCallback func() error) error {
193193
}
194194
}
195195
// this is the de facto wording in both firefox and deno at least
196-
return fmt.Errorf("Uncaught (in promise) %s", value) //nolint:stylecheck,staticcheck
196+
return fmt.Errorf("Uncaught (in promise) %s", value) //nolint:staticcheck
197197
}
198198
}
199199
}

internal/js/modules/k6/experimental/streams/readable_stream_default_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ func (controller *ReadableStreamDefaultController) pullSteps(readRequest ReadReq
220220
// [specification]: https://streams.spec.whatwg.org/#abstract-opdef-readablestreamdefaultcontroller-releasesteps
221221
func (controller *ReadableStreamDefaultController) releaseSteps() {
222222
// 1.
223-
return //nolint:gosimple,staticcheck
223+
return //nolint:staticcheck
224224
}
225225

226226
// close implements the [ReadableStreamDefaultControllerClose] algorithm

internal/js/modules/k6/grpc/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func buildTLSConfig(parentConfig *tls.Config, certificate, key []byte, caCertifi
155155
// Ignoring 'TLS MinVersion is too low' because this tls.Config will inherit MinValue and MaxValue
156156
// from the vu state tls.Config
157157

158-
//nolint:golint,gosec
158+
//nolint:gosec
159159
tlsCfg := &tls.Config{
160160
CipherSuites: parentConfig.CipherSuites,
161161
InsecureSkipVerify: parentConfig.InsecureSkipVerify,

internal/js/modules/k6/webcrypto/jwk.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const (
2020
)
2121

2222
// JsonWebKey represents a JSON Web Key (JsonWebKey) key.
23-
type JsonWebKey map[string]interface{} //nolint:stylecheck,revive // we name this type JsonWebKey to match the spec
23+
type JsonWebKey map[string]interface{} //nolint:revive // we name this type JsonWebKey to match the spec
2424

2525
// Set sets a key-value pair in the JWK.
2626
func (jwk *JsonWebKey) Set(key string, value interface{}) {

internal/js/tc39/tc39_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ var (
257257
update = flag.Bool("update", false, "update breaking_test_errors-*.json files") //nolint:gochecknoglobals
258258
)
259259

260-
//nolint:unused,structcheck
260+
//nolint:unused
261261
type tc39Test struct {
262262
name string
263263
f func(t *testing.T)
@@ -278,7 +278,7 @@ type tc39TestCtx struct {
278278
enableBench bool
279279
benchmark tc39BenchmarkData
280280
benchLock sync.Mutex
281-
testQueue []tc39Test //nolint:unused,structcheck
281+
testQueue []tc39Test //nolint:unused
282282
expectedErrors map[string]string
283283

284284
errorsLock sync.Mutex
@@ -419,7 +419,7 @@ func (ctx *tc39TestCtx) runTC39Test(t testing.TB, name, src string, meta *tc39Me
419419
}
420420

421421
var out []string
422-
async := meta.hasFlag("async") //nolint:ifshort // false positive
422+
async := meta.hasFlag("async")
423423
if async {
424424
err = ctx.runFile(ctx.base, path.Join("harness", "doneprintHandle.js"), vm)
425425
if err != nil {

internal/lib/netext/grpcext/conn.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ func (statsHandler) TagRPC(ctx context.Context, _ *grpcstats.RPCTagInfo) context
240240
// HandleRPC implements the grpcstats.Handler interface
241241
func (h statsHandler) HandleRPC(ctx context.Context, stat grpcstats.RPCStats) {
242242
state := h.getState()
243-
stateRPC := getRPCState(ctx) //nolint:ifshort
243+
stateRPC := getRPCState(ctx)
244244

245245
// If the request is done by the reflection handler then the tags will be
246246
// nil. In this case, we can reuse the VU.State's Tags.

internal/lib/testutils/httpmultibin/grpc_wrappers_testing/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Package grpc_wrappers_testing provides a test service that could be used for the testing gRPC wrappers
2-
package grpc_wrappers_testing //nolint:revive,stylecheck // we want to be consistent with the other packages
2+
package grpc_wrappers_testing //nolint:revive // we want to be consistent with the other packages
33

44
import (
55
context "context"

js/common/bridge_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ type bridgeTestFieldsType struct {
1212
Exported string
1313
ExportedTag string `js:"renamed"`
1414
ExportedHidden string `js:"-"`
15-
unexported string //nolint:structcheck,unused // actually checked in the test
16-
unexportedTag string `js:"unexported"` //nolint:structcheck,unused // actually checked in the test
15+
unexported string //nolint:unused // actually checked in the test
16+
unexportedTag string `js:"unexported"` //nolint:unused // actually checked in the test
1717
}
1818

1919
type bridgeTestMethodsType struct{}

0 commit comments

Comments
 (0)