Skip to content

Commit

Permalink
Testing out linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jansabbe committed Dec 2, 2023
1 parent 7c82400 commit 03ff0bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,13 @@ jobs:
with:
go-version: 1.21

- name: Linting
uses: golangci/golangci-lint-action@v3
with:
version: latest

- name: Check formatting
run: go fmt ./... && git diff --exit-code

- name: Run tests
run: go test -v ./...
2 changes: 1 addition & 1 deletion internal/day2/part1.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func getColorValue(value string, regex *regexp.Regexp) int {
if matches := regex.FindStringSubmatch(value); matches != nil {
result, err := strconv.Atoi(matches[1])
if err != nil {
log.Fatalf("matched %v but could not parse as int %v", matches[1], err)
log.Fatalf("matched %d but could not parse as int %v", matches[1], err)

Check failure on line 77 in internal/day2/part1.go

View workflow job for this annotation

GitHub Actions / test

printf: log.Fatalf format %d has arg matches[1] of wrong type string (govet)
}
return result
}
Expand Down

0 comments on commit 03ff0bf

Please sign in to comment.