Skip to content

Commit

Permalink
Merge pull request #1815 from keboola/lint-add-musttag-linter
Browse files Browse the repository at this point in the history
lint: Add musttag linter.
  • Loading branch information
Matovidlo authored Nov 22, 2024
2 parents f5f5d85 + 036ec35 commit 61dfa30
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions build/ci/golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ linters:
- ineffassign
- intrange
- 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"`
}

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

0 comments on commit 61dfa30

Please sign in to comment.