debian-mirror-gitlab/workhorse/internal/artifacts/escape_quotes.go

11 lines
214 B
Go
Raw Normal View History

2021-02-22 17:27:13 +05:30
package artifacts
import "strings"
// taken from mime/multipart/writer.go
var quoteEscaper = strings.NewReplacer("\\", "\\\\", `"`, "\\\"")
func escapeQuotes(s string) string {
return quoteEscaper.Replace(s)
}