diff --git a/.github/workflows/golang_lint.yaml b/.github/workflows/golang_lint.yaml new file mode 100644 index 0000000000..74e4d57613 --- /dev/null +++ b/.github/workflows/golang_lint.yaml @@ -0,0 +1,48 @@ +name: Linter + +on: + pull_request: + types: [opened, reopened, labeled, synchronize] + # paths: + # - '**/*.go' + # - '**/*.mod' + # - '**/*.sum' + push: + branches: + - pp + # paths: + # - '**/*.go' + # - '**/*.mod' + # - '**/*.sum' + workflow_dispatch: + inputs: + release_branch: + description: 'release branch name, example: release-1.68' + required: false + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + golangci: + runs-on: fsn-dev-gitlab-runner + steps: + - name: Clean workspace + uses: freenet-actions/action-clean@v1 + + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Lint + run: | + docker run --rm \ + -v $PWD:/workspace \ + -w /workspace \ + ${{ secrets.DEV_REGISTRY }}/prompp/ci-gcc-image:gcc-tools-x86_64 \ + bash -c " + export GOFLAGS=-buildvcs=false + golangci-lint run --verbose --config pp/.golangci.yml --timeout=10m + " \ No newline at end of file diff --git a/pp/go/model/labelset_test.go b/pp/go/model/labelset_test.go index 0fe486a89b..59c72c3572 100644 --- a/pp/go/model/labelset_test.go +++ b/pp/go/model/labelset_test.go @@ -29,7 +29,7 @@ func (s *LabelSetSuite) TestLabelSet_FromSlice() { }) s.Equal("__name__:example;container:~unknown;flags:empty;instance:instance;job:test;", ls.String()) } - +//test comment func (s *LabelSetSuite) TestLabelSet_FromMap() { ls := model.LabelSetFromMap(map[string]string{ "__name__": "example",