Skip to content

Fixed the linting errors #13

Fixed the linting errors

Fixed the linting errors #13

Workflow file for this run

name: Linting
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
env:
GOLANGCI_LINT_VERSION: v1.58.1
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.2'
- name: Install dependencies
run: |
go mod download
go mod tidy
- name: Run golangci-lint on PR
if: github.event_name == 'pull_request'
uses: golangci/golangci-lint-action@v3
with:
args: --new-from-rev ${{ github.event.pull_request.base.sha }} --config .golangci.yaml --out-format=colored-line-number
version: ${{ env.GOLANGCI_LINT_VERSION }}
- name: Run golangci-lint on main branch push
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: golangci/golangci-lint-action@v3
with:
args: --config .golangci.yaml --out-format=colored-line-number || exit 1
version: ${{ env.GOLANGCI_LINT_VERSION }}