From 13960ae8aef652bfd853c8311531b50f3d7f58c6 Mon Sep 17 00:00:00 2001 From: David Symonds Date: Wed, 15 Jul 2009 23:24:27 -0700 Subject: [PATCH] exvar: new Timer var type. R=rsc APPROVED=r DELTA=146 (142 added, 0 deleted, 4 changed) OCL=31654 CL=31716 --- src/pkg/Make.deps | 2 +- src/pkg/exvar/exvar.go | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pkg/Make.deps b/src/pkg/Make.deps index b58d2cc5f6..1241bb4797 100644 --- a/src/pkg/Make.deps +++ b/src/pkg/Make.deps @@ -41,7 +41,7 @@ path.install: strings.install rand.install: reflect.install: runtime.install strconv.install strings.install regexp.install: bytes.install container/vector.install io.install os.install runtime.install utf8.install -rpc.install: bufio.install gob.install http.install io.install log.install net.install os.install reflect.install strconv.install strings.install sync.install time.install unicode.install utf8.install +rpc.install: bufio.install gob.install http.install io.install log.install net.install os.install reflect.install strconv.install strings.install sync.install unicode.install utf8.install runtime.install: sort.install: strconv.install: bytes.install math.install os.install utf8.install diff --git a/src/pkg/exvar/exvar.go b/src/pkg/exvar/exvar.go index 6275e2d258..7849714978 100644 --- a/src/pkg/exvar/exvar.go +++ b/src/pkg/exvar/exvar.go @@ -162,6 +162,14 @@ func Get(name string) Var { return nil } +// RemoveAll removes all exported variables. +// This is for tests; don't call this on a real server. +func RemoveAll() { + mutex.Lock(); + defer mutex.Unlock(); + vars = make(map[string] Var); +} + // Convenience functions for creating new exported variables. func NewInt(name string) *Int {