Skip to content

Commit

Permalink
test fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
jwijenbergh committed Nov 16, 2023
1 parent 8fc572c commit d4b43b1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
name: "Test & check build"

on: [ push, pull_request ]
on: [push, pull_request]

jobs:
fmt-go:
runs-on: ubuntu-latest

steps:
- uses: actions/setup-go@v3
with:
go-version: ^1.18
- uses: actions/checkout@v3
- name: Install gofumpt
run: go install mvdan.cc/gofumpt@latest
- name: Check fmt using gofumpt
run: |
files=$(~/go/bin/gofumpt -l -d .);
if [[ -n "$files" ]]; then
printf '%s\ngofumpt would make changes, install gofumpt and run "make lint"' "$files";
exit 1;
fi
shell: bash

lint-go:
name: Lint Go
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ help: ## Print this help message
lint:
golangci-lint run -E stylecheck,revive,gocritic --timeout 5m

fmt:
gofumpt -w ./...

build-cli: .build-cli ## Build CLI version
@echo "Done building, run 'make run-cli' to run the CLI"

Expand Down
2 changes: 1 addition & 1 deletion cmd/geteduroam-gui/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (s *serverList) get(idx int) (*instance.Instance, error) {
if idx < 0 || idx > len(s.instances) {
return nil, errors.New("index out of range")
}
return &s.instances[idx], nil
return &s.instances[idx], nil
}

func (s *serverList) Fill() {
Expand Down

0 comments on commit d4b43b1

Please sign in to comment.