8000 Add return to reduce indentation in serveFile · coder/coder@0743503 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0743503

Browse files
committed
Add return to reduce indentation in serveFile
1 parent 34e4f46 commit 0743503

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

nextrouter/nextrouter.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,12 @@ func serveFile(router chi.Router, fileSystem fs.FS, fileName string, options Opt
172172
// Special case: '/' should serve index.html
173173
if fileName == "index.html" {
174174
router.Get("/", handler)
175-
} else {
176-
// Otherwise, handling the trailing slash case -
177-
// for examples, `providers.html` should serve `/providers/`
178-
router.Get("/"+fileNameWithoutExtension+"/", handler)
175+
return
179176
}
177+
178+
// Otherwise, handling the trailing slash case -
179+
// for examples, `providers.html` should serve `/providers/`
180+
router.Get("/"+fileNameWithoutExtension+"/", handler)
180181
}
181182

182183
func serve404IfAvailable(fileSystem fs.FS, router chi.Router, options Options) {

0 commit comments

Comments
 (0)
0