diff options
Diffstat (limited to 'pkg/server/env')
| -rw-r--r-- | pkg/server/env/env.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/server/env/env.go b/pkg/server/env/env.go index affb4ef..fe8af25 100644 --- a/pkg/server/env/env.go +++ b/pkg/server/env/env.go @@ -16,6 +16,7 @@ type Env struct { } const namePattern = "[a-zA-Z][a-zA-Z0-9.]*" + var isNamePattern = regexp.MustCompile("^" + namePattern + "$").MatchString var namePatternRe = regexp.MustCompile("@" + namePattern) @@ -91,7 +92,7 @@ func (e *env) Del(key string) bool { return true } -func (e *env) Each(f func (string, string) bool) { +func (e *env) Each(f func(string, string) bool) { e.Lock() defer e.Unlock() @@ -113,7 +114,7 @@ func (e *env) Eval(s string) string { e.Lock() defer e.Unlock() - repl := func (v string) string { + repl := func(v string) string { if v, ok := e.m[v[1:]]; ok { return v } |
