[golangci-lint]: regexp: Use MustCompile instead of Compile.

errwrp
Martin Dosch 1 year ago
parent 1e032e7174
commit 94e82bdef5
No known key found for this signature in database
GPG Key ID: 52A57CFCE13D657D

@ -47,10 +47,7 @@ func httpUpload(client *xmpp.Client, iqc chan xmpp.IQ,
fileName := filepath.Base(filePath)
// Just use alphanumerical and some special characters for now
// to work around https://github.com/mattn/go-xmpp/issues/132
reg, err := regexp.MustCompile(`[^a-zA-Z0-9\+\-\_\.]+`)
if err != nil {
log.Fatal(err)
}
reg := regexp.MustCompile(`[^a-zA-Z0-9\+\-\_\.]+`)
fileNameEscaped := reg.ReplaceAllString(fileName, "_")
// Query server for disco#items

Loading…
Cancel
Save