feat: add go check #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Golang Check | |
on: | |
pull_request: | |
branches: | |
- main | |
- develop | |
jobs: | |
golang-check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '^1.19' | |
- name: Check Go syntax | |
run: | | |
find . -name "*.go" | xargs gofmt -l | |
if [[ -n $(find . -name "*.go" | xargs gofmt -l) ]]; then | |
echo "Go files are not syntactically valid, try running 'gofmt -w' to find issues" | |
exit 1 | |
fi |