Skip to content

Commit 4d87701

Browse files
committed
Add linter and failing test case
1 parent 02db5ac commit 4d87701

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,19 @@ jobs:
2929
runs-on: ubuntu-latest
3030

3131
steps:
32-
- name: Run formatting test
32+
- name: Check out code
33+
uses: actions/checkout@v4
34+
35+
- name: Set up Go
36+
uses: actions/setup-go@v5
37+
with:
38+
go-version: "1.25.1"
39+
40+
- name: Check formatting
3341
run: test -z $(go fmt ./...)
42+
43+
- name: Install staticcheck
44+
run: go install honnef.co/go/tools/cmd/staticcheck@latest
45+
46+
- name: Run staticcheck
47+
run: staticcheck ./...

internal/auth/auth_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ func TestGetAPIKey(t *testing.T) {
2424
for _, tc := range tests {
2525
got, err := GetAPIKey(tc.header)
2626
if (err != nil) != tc.wantErr {
27-
fmt.Sprintf("Got issue in test case %s", tc.name)
2827
t.Fatalf("expected error: %v, got %v", tc.wantErr, err)
2928
}
3029
if got != tc.want {

main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ type apiConfig struct {
2121
DB *database.Queries
2222
}
2323

24+
2425
//go:embed static/*
2526
var staticFiles embed.FS
2627

0 commit comments

Comments
 (0)