expvar: revise API.
Nuke RemoveAll from the public API.
Replace Iter functions with Do functions.
Fixes #2852.
R=rsc, r
CC=golang-dev
https://golang.org/cl/5622055
diff --git a/src/pkg/expvar/expvar_test.go b/src/pkg/expvar/expvar_test.go
index fc60727..bbd9dd8 100644
--- a/src/pkg/expvar/expvar_test.go
+++ b/src/pkg/expvar/expvar_test.go
@@ -9,6 +9,14 @@
"testing"
)
+// RemoveAll removes all exported variables.
+// This is for tests only.
+func RemoveAll() {
+ mutex.Lock()
+ defer mutex.Unlock()
+ vars = make(map[string]Var)
+}
+
func TestInt(t *testing.T) {
reqs := NewInt("requests")
if reqs.i != 0 {