MCPcopy
hub / github.com/gin-gonic/gin / joinPaths

Function joinPaths

utils.go:135–145  ·  view source on GitHub ↗
(absolutePath, relativePath string)

Source from the content-addressed store, hash-verified

133}
134
135func joinPaths(absolutePath, relativePath string) string {
136 if relativePath == "" {
137 return absolutePath
138 }
139
140 finalPath := path.Join(absolutePath, relativePath)
141 if lastChar(relativePath) == '/' && lastChar(finalPath) != '/' {
142 return finalPath + "/"
143 }
144 return finalPath
145}
146
147func resolveAddress(addr []string) string {
148 switch len(addr) {

Callers 2

TestJoinPathsFunction · 0.85
calculateAbsolutePathMethod · 0.85

Calls 1

lastCharFunction · 0.85

Tested by 1

TestJoinPathsFunction · 0.68