Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint: Add musttag linter. #1815

Merged
merged 2 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build/ci/golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ linters:
- importas
- ineffassign
- makezero
- musttag
- nakedret
- nilerr
- noctx
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/service/common/etcdop/op/op_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type testOp struct {
}

type testValue struct {
Foo string
Foo string `json:"foo"`
}

Matovidlo marked this conversation as resolved.
Show resolved Hide resolved
type opTestCase[R any] struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/service/stream/api/mapper/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (m *Mapper) NewTaskResponse(entity task.Task) (*api.Task, error) {
// Outputs
if entity.Outputs != nil {
response.Outputs = &api.TaskOutputs{}
err := mapstructure.Decode(entity.Outputs, response.Outputs)
err := mapstructure.Decode(entity.Outputs, response.Outputs) // nolint: musttag
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/service/stream/migrate/core/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (r *Receiver) createSourcePayload() (*bytes.Buffer, error) {
}

payloadBuf := new(bytes.Buffer)
err := json.NewEncoder(payloadBuf).Encode(s)
err := json.NewEncoder(payloadBuf).Encode(s) // nolint:musttag
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions test/stream/bridge/keboola/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func (ts *testState) setupSourceThroughAPI(t *testing.T, ctx context.Context, ex
Type: "http",
Name: "testSource",
}
out, err := json.Marshal(payload)
out, err := json.Marshal(payload) // nolint:musttag
if !assert.NoError(t, err) {
ts.logger.Errorf(ctx, "unable to marshal source create payload: %v", err)
return
Expand Down Expand Up @@ -369,7 +369,7 @@ func (ts *testState) setupSinkThroughAPI(t *testing.T, ctx context.Context, expe
Type: definition.SinkTypeTable,
Name: "testSink",
}
out, err := json.Marshal(payload)
out, err := json.Marshal(payload) // nolint:musttag
if !assert.NoError(t, err) {
ts.logger.Errorf(ctx, "unable to marshal sink create payload: %v", err)
return
Expand Down