Skip to content

Commit 8bc3544

Browse files
committed
Add linter and fix failing test case
1 parent 02db5ac commit 8bc3544

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package auth
22

33
import (
4-
"fmt"
54
"net/http"
65
"testing"
76
)
@@ -24,7 +23,6 @@ func TestGetAPIKey(t *testing.T) {
2423
for _, tc := range tests {
2524
got, err := GetAPIKey(tc.header)
2625
if (err != nil) != tc.wantErr {
27-
fmt.Sprintf("Got issue in test case %s", tc.name)
2826
t.Fatalf("expected error: %v, got %v", tc.wantErr, err)
2927
}
3028
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)