chore: rename getQueryCache/getFormCache to initQueryCache/initFormCache (#2375)
This commit is contained in:
13
utils.go
13
utils.go
@ -90,13 +90,13 @@ func filterFlags(content string) string {
|
||||
}
|
||||
|
||||
func chooseData(custom, wildcard interface{}) interface{} {
|
||||
if custom == nil {
|
||||
if wildcard == nil {
|
||||
panic("negotiation config is invalid")
|
||||
}
|
||||
if custom != nil {
|
||||
return custom
|
||||
}
|
||||
if wildcard != nil {
|
||||
return wildcard
|
||||
}
|
||||
return custom
|
||||
panic("negotiation config is invalid")
|
||||
}
|
||||
|
||||
func parseAccept(acceptHeader string) []string {
|
||||
@ -127,8 +127,7 @@ func joinPaths(absolutePath, relativePath string) string {
|
||||
}
|
||||
|
||||
finalPath := path.Join(absolutePath, relativePath)
|
||||
appendSlash := lastChar(relativePath) == '/' && lastChar(finalPath) != '/'
|
||||
if appendSlash {
|
||||
if lastChar(relativePath) == '/' && lastChar(finalPath) != '/' {
|
||||
return finalPath + "/"
|
||||
}
|
||||
return finalPath
|
||||
|
Reference in New Issue
Block a user