mirror of
https://github.com/rclone/rclone.git
synced 2024-11-07 09:04:52 +01:00
fspath: refactor away unnecessary constant for remote name regex
This commit is contained in:
parent
c571200812
commit
3937233e1e
@ -14,7 +14,6 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
configNameRe = `[\w. -]+`
|
configNameRe = `[\w. -]+`
|
||||||
remoteNameRe = `:?` + configNameRe
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -35,7 +34,7 @@ var (
|
|||||||
configNameMatcher = regexp.MustCompile(`^` + configNameRe + `$`)
|
configNameMatcher = regexp.MustCompile(`^` + configNameRe + `$`)
|
||||||
|
|
||||||
// remoteNameMatcher is a pattern to match an rclone remote name at the start of a config
|
// 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
|
// CheckConfigName returns an error if configName is invalid
|
||||||
|
Loading…
Reference in New Issue
Block a user