Skip to content

Commit

Permalink
refactor: Use global vars instead of local vars for func cleanPath
Browse files Browse the repository at this point in the history
  • Loading branch information
LimJiAn committed Sep 2, 2023
1 parent dc9cff7 commit edaa234
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion path.go
Expand Up @@ -5,6 +5,8 @@

package gin

const stackBufSize = 128

// cleanPath is the URL version of path.Clean, it returns a canonical URL path
// for p, eliminating . and .. elements.
//
Expand All @@ -19,7 +21,6 @@ package gin
//
// If the result of this process is an empty string, "/" is returned.
func cleanPath(p string) string {
const stackBufSize = 128
// Turn empty string into "/"
if p == "" {
return "/"
Expand Down

0 comments on commit edaa234

Please sign in to comment.