Skip to content

Commit b41e102

Browse files
committed
ci: integrate golangci-lint with CI and update project documentation
- Add a GitHub Actions workflow to run golangci-lint on pushes and pull requests to master - Display golangci-lint status badge in the README Signed-off-by: Bo-Yi Wu <[email protected]>
1 parent 5a584bf commit b41e102

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: golangci-lint
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
workflow_dispatch: # Allow manual trigger
11+
12+
permissions:
13+
contents: read
14+
pull-requests: read # Required for pull request comments
15+
16+
jobs:
17+
golangci:
18+
name: golangci-lint
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v6
23+
24+
- name: Set up Go
25+
uses: actions/setup-go@v6
26+
with:
27+
go-version: "1.24"
28+
cache: true
29+
30+
- name: Setup golangci-lint
31+
uses: golangci/golangci-lint-action@v9
32+
with:
33+
version: v2.6
34+
args: --verbose

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Gin Examples
22

33
[![Trivy Security Scan](https://github.com/gin-gonic/examples/actions/workflows/trivy-scan.yml/badge.svg)](https://github.com/gin-gonic/examples/actions/workflows/trivy-scan.yml)
4+
[![golangci-lint](https://github.com/gin-gonic/examples/actions/workflows/golangci-lint.yml/badge.svg)](https://github.com/gin-gonic/examples/actions/workflows/golangci-lint.yml)
45

56
This repository contains a number of ready-to-run examples demonstrating various use cases of [Gin](https://github.com/gin-gonic/gin).
67

0 commit comments

Comments
 (0)