Skip to content

Commit

Permalink
Create go-format-check.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
lvmingze123 authored Oct 12, 2024
1 parent e0dee16 commit 7531700
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/go-format-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Check Go Code Format

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
gofmt-check:
name: Check Go Format
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23.1'

- name: Run gofmt to check formatting
run: |
if [ -n "$(gofmt -l .)" ]; then
echo "Go code is not properly formatted."
exit 1
else
echo "Go code is properly formatted."
fi

0 comments on commit 7531700

Please sign in to comment.