hanayo/vendor/github.com/thehowl/conf/escape.go

16 lines
256 B
Go
Raw Normal View History

2019-02-23 13:29:15 +00:00
package conf
import (
"strings"
)
// Escape escapes characters for then putting it into conf field/values without issues.
func Escape(s string) string {
return strings.NewReplacer(
"\n", "\\\n",
`\`, `\\`,
`;`, `\;`,
`=`, `\=`,
).Replace(s)
}