Repository navigation
Conversation
| // - https://github.com/rootless-containers/rootlesskit/pull/188 | ||
| func createCleanupLock(sDir string) error { | ||
| //lock state dir when using /tmp/ path | ||
| // lock state dir when using /tmp/ path |
There was a problem hiding this comment.
nit: could be a separate commit
There was a problem hiding this comment.
oh! Yeah, can do; didn't notice it formatted it.
There was a problem hiding this comment.
reverted it for now; I considered running gofumpt and enabling it as formatter in golangci-lint, but that resulted in various other changes, so keeping that for a follow-up.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
b067b15 to
410c04b
Compare
| func AddRoutes(r *http.ServeMux, b *Backend) { | ||
| r.HandleFunc("GET /v1/ports", b.GetPorts) | ||
| r.HandleFunc("POST /v1/ports", b.PostPort) | ||
| r.HandleFunc("DELETE /v1/ports/{$}", b.DeletePort) // Preserve the 400 response for a missing port ID instead of returning 404. |
There was a problem hiding this comment.
nit: The comment string could be moved to DeletePort()
There was a problem hiding this comment.
🟡 Changes recommended
The added empty-ID route changes existing API behavior instead of preserving it.
1 open finding
What changed in this PR
Replaces Gorilla Mux with Go’s standard HTTP router for the API server.
Changes:
- Migrates API route registration to
http.ServeMux. - Uses
Request.PathValuefor port IDs. - Removes the Gorilla Mux dependency.
| File | Description |
|---|---|
pkg/parent/parent.go |
Creates the API router with http.NewServeMux. |
pkg/api/router/router.go |
Migrates route definitions and path parameters. |
go.mod |
Removes the direct Gorilla Mux dependency. |
go.sum |
Removes Gorilla Mux checksums. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| func AddRoutes(r *http.ServeMux, b *Backend) { | ||
| r.HandleFunc("GET /v1/ports", b.GetPorts) | ||
| r.HandleFunc("POST /v1/ports", b.PostPort) | ||
| r.HandleFunc("DELETE /v1/ports/{$}", b.DeletePort) // Preserve the 400 response for a missing port ID instead of returning 404. |

No description provided.