fspath: refactor away unnecessary constant for remote name regex

This commit is contained in:
albertony 2022-09-16 16:20:19 +02:00 committed by Nick Craig-Wood
parent c571200812
commit 3937233e1e
1 changed files with 1 additions and 2 deletions

View File

@ -14,7 +14,6 @@ import (
const (
configNameRe = `[\w. -]+`
remoteNameRe = `:?` + configNameRe
)
var (
@ -35,7 +34,7 @@ var (
configNameMatcher = regexp.MustCompile(`^` + configNameRe + `$`)
// remoteNameMatcher is a pattern to match an rclone remote name at the start of a config
remoteNameMatcher = regexp.MustCompile(`^` + remoteNameRe + `(?::$|,)`)
remoteNameMatcher = regexp.MustCompile(`^:?` + configNameRe + `(?::$|,)`)
)
// CheckConfigName returns an error if configName is invalid