-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Summary
Three pre-existing go vet warnings remain after the cleanup in PR #402. These are non-blocking (no runtime impact) but should be fixed for code quality.
1. shock-server/auth/oauth/oauth.go:23 — unexported field with json tag
type resErr struct {
error string `json:"error"`
}The field error is unexported (lowercase), so encoding/json will never marshal or unmarshal it. The json:"error" tag has no effect.
Fix: Either export the field (Error string \json:"error"``) or remove the json tag if it's only used internally.
2. shock-server/request/request.go:279 — unreachable code
The ParseMultipartForm function contains an infinite for {} loop (line 127) that only exits via return statements inside the loop body (line 141 on EOF/error, and various error returns in the loop body). The return at line 279 after the loop closing brace is unreachable.
Fix: Remove the unreachable return on line 279. The function's named return values are already returned by the in-loop return statements.
3. shock-server/reload.go:39 — unreachable code
The reload() function has an if/else where both branches end with return statements (line 26 for URL source, line 37 for directory source). The return on line 39 after the closing } of the else block is unreachable.
Fix: Remove the unreachable return on line 39.
Verification
After fixes, confirm with:
go vet -mod=vendor ./shock-server/... ./shock-client/...References
- PR Add cache-to-S3 upload, Chi router, test infrastructure, and build fixes #402 review session
- These warnings pre-date the PR Add cache-to-S3 upload, Chi router, test infrastructure, and build fixes #402 branch changes