diff --git a/client.go b/client.go index f94d0dc..d1fb1cd 100644 --- a/client.go +++ b/client.go @@ -120,7 +120,7 @@ func (c *Client) DelLock(key string) error { } func IsValidAsKeyPath(s string) bool { - return strings.IndexByte(s, '/') == -1 + return strings.IndexAny(s, "/\\") == -1 } // etcdTimeoutContext return better error info diff --git a/errors.go b/errors.go index 4d7285a..5815751 100644 --- a/errors.go +++ b/errors.go @@ -8,8 +8,8 @@ var ( ErrEmptyJobName = errors.New("Name of job is empty.") ErrEmptyJobCommand = errors.New("Command of job is empty.") - ErrIllegalJobId = errors.New("Invalid id that includes illegal characters such as '/'.") - ErrIllegalJobGroupName = errors.New("Invalid job group name that includes illegal characters such as '/'.") + ErrIllegalJobId = errors.New("Invalid id that includes illegal characters such as '/' '\\'.") + ErrIllegalJobGroupName = errors.New("Invalid job group name that includes illegal characters such as '/' '\\'.") ErrEmptyNodeGroupName = errors.New("Name of node group is empty.") ErrIllegalNodeGroupId = errors.New("Invalid node group id that includes illegal characters such as '/'.")