Skip to content

Commit 487b4f4

Browse files
committed
refactor(serverHandler): simplify getSubItemPrefix
1 parent 73087be commit 487b4f4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/serverHandler/responseData.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,12 @@ func (h *handler) mergeAlias(rawRequestPath string, item os.FileInfo, subItems [
183183
return subItems, errs
184184
}
185185

186-
func getSubItemPrefix(requestPath string, tailSlash bool) (subItemPrefix string) {
186+
func getSubItemPrefix(requestPath string, tailSlash bool) string {
187187
if tailSlash {
188-
subItemPrefix = "./"
188+
return "./"
189189
} else {
190-
subItemPrefix = "./" + path.Base(requestPath) + "/"
190+
return "./" + path.Base(requestPath) + "/"
191191
}
192-
return
193192
}
194193

195194
func getItemName(info os.FileInfo, r *http.Request) (itemName string) {

0 commit comments

Comments
 (0)