8000 Remove call to remove file extension · coder/coder@4585c13 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4585c13

Browse files
committed
Remove call to remove file extension
1 parent 0743503 commit 4585c13

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

nextrouter/nextrouter.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,8 @@ func serve404IfAvailable(fileSystem fs.FS, router chi.Router, options Options) {
200200

201201
// isDynamicRoute returns true if the file is a NextJS dynamic route, like `[orgs]`
202202
// Returns false if the file is not a dynamic route, or if it is a catch-all route (`[[...any]]`)
203-
func isDynamicRoute(fileName string) bool {
204-
fileWithoutExtension := removeFileExtension(fileName)
205-
203+
// NOTE: The extension should be removed from the file name
204+
func isDynamicRoute(fileWithoutExtension string) bool {
206205
// Assuming ASCII encoding - `len` in go works on bytes
207206
byteLen := len(fileWithoutExtension)
208207
if byteLen < 2 {
@@ -214,8 +213,8 @@ func isDynamicRoute(fileName string) bool {
214213

215214
// isCatchAllRoute returns true if the file is a catch-all route, like `[[...any]]`
216215
// Return false otherwise
217-
func isCatchAllRoute(fileName string) bool {
218-
fileWithoutExtension := removeFileExtension(fileName)
216+
// NOTE: The extension should be removed from the file name
217+
func isCatchAllRoute(fileWithoutExtension string) bool {
219218
ret := strings.HasPrefix(fileWithoutExtension, "[[.")
220219
return ret
221220
}

0 commit comments

Comments
 (0)
0