Skip to content

Commit

Permalink
Resolve lint error ineffectual assignment to path (ineffassign)
Browse files Browse the repository at this point in the history
This resolves an error raised by the linter

```
Error: pkg/ui/routes.go:27:2: ineffectual assignment to path (ineffassign)
  	path, err := filepath.Abs(r.URL.Path)
```

Signed-off-by: Phillip Rak <[email protected]>
  • Loading branch information
rak-phillip committed Jul 16, 2024
1 parent 88d7cea commit bd55b9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/ui/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type spaHandler struct {
// is suitable behavior for serving an SPA (single page application).
func (h spaHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// get the absolute path to prevent directory traversal
path, err := filepath.Abs(r.URL.Path)
_, err := filepath.Abs(r.URL.Path)
if err != nil {
// if we failed to get the absolute path respond with a 400 bad request
// and stop
Expand Down

0 comments on commit bd55b9a

Please sign in to comment.