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 12a8ae5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
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
- run: |
go install mvdan.cc/gofumpt@latest
files=$(~/go/bin/gofumpt -l -d .)
[[ ! -z "$files" ]] && { printf '%s\ngofumpt would make changes, install gofumpt and run "make lint"' "$files"; exit 1; }
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 12a8ae5

Please sign in to comment.