Skip to content

Commit 71a0851

Browse files
committed
Fix keepalive: use method expressions and correct names
1 parent 903c4c1 commit 71a0851

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

keepalive_staticcheck.go

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
11
package main
22

3-
// This file references otherwise-unused symbols so staticcheck (U1000) doesn't fail in the tutorial repo.
4-
// It has no runtime effect.
3+
// References otherwise-unused symbols so staticcheck (U1000) doesn't fail in the tutorial repo.
4+
// No runtime effect.
55

66
var (
7-
_ = apiConfig{}
7+
// Methods on *apiConfig — use method expressions
8+
_ = (*apiConfig).handlerNotesGet
9+
_ = (*apiConfig).handlerNotesCreate
10+
_ = (*apiConfig).handlerUsersCreate
11+
_ = (*apiConfig).handlerUsersGet
12+
_ = (*apiConfig).middlewareAuth
813

9-
// handlers
10-
_ = handlerNotesGet
11-
_ = handlerNotesCreate
12-
_ = handlerReadiness
13-
_ = handlerUsersCreate
14-
_ = handlerUsersGet
15-
16-
// helpers
14+
// Plain functions
15+
_ = handleReadiness
1716
_ = generateRandomSHA256Hash
1817
_ = respondWithError
1918
_ = respondWithJSON
2019
_ = writeJSON
2120

22-
// middleware
21+
// Types / zero values
2322
_ = authMiddleware{}
24-
_ = middlewareAuth
2523

26-
// model mappers
24+
// Model mapping helpers
2725
_ = databaseUserToUser
2826
_ = databaseNoteToNote
2927
_ = databasePostsToPosts

0 commit comments

Comments
 (0)