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

Adds linters to Go modules #626

Merged
merged 12 commits into from
Nov 30, 2023
24 changes: 24 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Lint Go Code

on:
pull_request:
paths:
- '**/*.go'

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
blumamir marked this conversation as resolved.
Show resolved Hide resolved

- name: Set up Go
uses: actions/setup-go@v2
blumamir marked this conversation as resolved.
Show resolved Hide resolved
with:
go-version: 1.19.0
blumamir marked this conversation as resolved.
Show resolved Hide resolved

- name: Run golangci-lint
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read the documentation for the action:

Note: By default, the .golangci.yml file should be at the root of the repository.

From looking at the reference repo here, it seems to contain a .golangci.yml file as well, but such a file is not added to this repo in this PR.

I wonder if it's intentional

Copy link
Contributor Author

@ankur0904 ankur0904 Oct 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blumamir
Sorry for this but I am unable to understand.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blumamir Sorry for this but I am unable to understand.

@ankur0904 I think that you also need to add a .golangci.yml file to the project, which this github actions will look for.

uses: golangci/golangci-lint-action@v2
blumamir marked this conversation as resolved.
Show resolved Hide resolved
with:
version: latest
blumamir marked this conversation as resolved.
Show resolved Hide resolved