Skip to content

Commit

Permalink
golangci-lint fix issue & disable only-new-issues (#11133)
Browse files Browse the repository at this point in the history
* core/services/ocr/plugins/generic: rm unused error return

* .github/actions/golangci-lint: disable only-new-issues
  • Loading branch information
jmank88 authored Oct 31, 2023
1 parent 8fba9c8 commit 9fd1d5d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/actions/golangci-lint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ runs:
skip-pkg-cache: true
skip-build-cache: true
# only-new-issues is only applicable to PRs, otherwise it is always set to false
only-new-issues: true
only-new-issues: false # disabled for PRs due to unreliability
args: --out-format colored-line-number,checkstyle:golangci-lint-report.xml
working-directory: ${{ inputs.go-directory }}
- name: Store lint report artifact
Expand Down
9 changes: 2 additions & 7 deletions core/services/ocr2/plugins/generic/pipeline_runner_adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ func (p *PipelineRunnerAdapter) ExecuteRun(ctx context.Context, spec string, var
},
}

err := merge(defaultVars, vars.Vars)
if err != nil {
return nil, err
}
merge(defaultVars, vars.Vars)

finalVars := pipeline.NewVarsFrom(defaultVars)
_, trrs, err := p.runner.ExecuteRun(ctx, s, finalVars, p.logger)
Expand Down Expand Up @@ -74,7 +71,7 @@ func NewPipelineRunnerAdapter(logger logger.Logger, job job.Job, runner pipeline
}

// merge merges mapTwo into mapOne, modifying mapOne in the process.
func merge(mapOne, mapTwo map[string]interface{}) error {
func merge(mapOne, mapTwo map[string]interface{}) {
for k, v := range mapTwo {
// if `mapOne` doesn't have `k`, then nothing to do, just assign v to `mapOne`.
if _, ok := mapOne[k]; !ok {
Expand All @@ -89,6 +86,4 @@ func merge(mapOne, mapTwo map[string]interface{}) error {
}
}
}

return nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ func TestMerge(t *testing.T) {
"val": 0,
}

err := merge(vars, addedVars)
require.NoError(t, err)
merge(vars, addedVars)

assert.True(t, reflect.DeepEqual(vars, map[string]interface{}{
"jb": map[string]interface{}{
Expand Down

0 comments on commit 9fd1d5d

Please sign in to comment.