Skip to content

docs: 添加返回结构文档并补充使用条件 #83

docs: 添加返回结构文档并补充使用条件

docs: 添加返回结构文档并补充使用条件 #83

name: Backend Pull Request Check
on:
pull_request:
branches:
- main
permissions:
contents: read
jobs:
golangci-lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.24'
cache-dependency-path: 'go.sum'
- name: golangci-lint
uses: golangci/golangci-lint-action@v8
with:
version: v2.1
working-directory: .
args: --timeout 5m
go-mod-check:
name: go mod check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.24'
cache-dependency-path: 'go.sum'
- name: Check go.mod formatting
working-directory: .
run: |
if ! go mod tidy --diff ; then
echo "::error::go.mod or go.sum is not properly formatted. Please run 'go mod tidy' locally and commit the changes."
exit 1
fi
if ! go mod verify ; then
echo "::error::go.mod or go.sum has unverified dependencies. Please run 'go mod verify' locally and commit the changes."
exit 1
fi