Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
package fn
// RemoveTrailingSlash removes the trailing slash from a string.
// If the string is just "/", it returns "/" unchanged.
func RemoveTrailingSlash(str string) string {
if str == "/" {
return str
}
if str != "" && str[len(str)-1] == '/' {
return str[:len(str)-1]
}
return str
}