AUTH-2021 - s3 bucket uploading for SSH logs

This commit is contained in:
Dalton
2019-08-26 15:56:17 -05:00
parent ef5b44b2d0
commit f130e6d4d7
187 changed files with 57272 additions and 4 deletions

View File

@@ -0,0 +1,23 @@
package sdkuri
import (
"path"
"strings"
)
// PathJoin will join the elements of the path delimited by the "/"
// character. Similar to path.Join with the exception the trailing "/"
// character is preserved if present.
func PathJoin(elems ...string) string {
if len(elems) == 0 {
return ""
}
hasTrailing := strings.HasSuffix(elems[len(elems)-1], "/")
str := path.Join(elems...)
if hasTrailing && str != "/" {
str += "/"
}
return str
}