mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-22 08:26:19 +01:00
05cf8a6ecc
vmctl: support of the remote read protocol Signed-off-by: hagen1778 <roman@victoriametrics.com> Co-authored-by: hagen1778 <roman@victoriametrics.com>
24 lines
453 B
Go
24 lines
453 B
Go
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
|
|
}
|